本文整理汇总了C++中corba::TypeCode_ptr::id方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_ptr::id方法的具体用法?C++ TypeCode_ptr::id怎么用?C++ TypeCode_ptr::id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::TypeCode_ptr
的用法示例。
在下文中一共展示了TypeCode_ptr::id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NO_IMPLEMENT
CORBA::TypeCode_ptr
TAO_Repository_i::get_canonical_typecode_i (CORBA::TypeCode_ptr tc)
{
CORBA::TCKind kind = tc->kind ();
switch (kind)
{
// For all the TCKinds not covered below, no change is needed.
default:
return CORBA::TypeCode::_duplicate (tc);
case CORBA::tk_fixed:
throw CORBA::NO_IMPLEMENT ();
case CORBA::tk_array:
{
CORBA::ULong length = tc->length ();
CORBA::TypeCode_var ctype = tc->content_type ();
CORBA::TypeCode_var canon_ctype =
this->get_canonical_typecode_i (ctype.in ());
return this->tc_factory ()->create_array_tc (length,
canon_ctype.in ());
}
case CORBA::tk_sequence:
{
CORBA::ULong length = tc->length ();
CORBA::TypeCode_var ctype = tc->content_type ();
CORBA::TypeCode_var canon_ctype =
this->get_canonical_typecode_i (ctype.in ());
return this->tc_factory ()->create_sequence_tc (length,
canon_ctype.in ());
}
case CORBA::tk_alias:
case CORBA::tk_objref:
case CORBA::tk_struct:
case CORBA::tk_union:
case CORBA::tk_enum:
case CORBA::tk_except:
case CORBA::tk_value:
case CORBA::tk_value_box:
case CORBA::tk_native:
case CORBA::tk_abstract_interface:
case CORBA::tk_component:
case CORBA::tk_home:
{
CORBA::String_var id = tc->id ();
ACE_TString path;
int status =
this->config ()->get_string_value (this->repo_ids_key (),
id.in (),
path);
// TODO - something in case the repo id is an empty string,
// or if it is not found in this repository
if (status != 0)
{
return CORBA::TypeCode::_nil ();
}
ACE_Configuration_Section_Key key;
this->config ()->expand_path (this->root_key (),
path,
key,
0);
// An ExceptionDef is not an IDLType.
if (kind == CORBA::tk_except)
{
TAO_ExceptionDef_i impl (this->repo_);
impl.section_key (key);
return impl.type_i ();
}
else
{
TAO_IDLType_i *impl =
TAO_IFR_Service_Utils::path_to_idltype (path,
this);
impl->section_key (key);
return impl->type_i ();
}
}
}
}
示例2: synchro
CORBA::TypeCode_ptr
TIDorb::core::typecode::TypeCodeCache::put(CORBA::TypeCode_ptr type)
throw (CORBA::INTERNAL)
{
TIDThr::Synchronized synchro(recursive_mutex);
CORBA::RepositoryId rep_id = NULL;
try{
rep_id = (char*) type->id();
}
catch (const CORBA::TypeCode::BadKind& badKind) {
throw CORBA::INTERNAL("Only Complex Typecodes can be put in the cache");
}
if (rep_id == NULL)
throw CORBA::INTERNAL("Cannot get RepositoryId");
char *pointer = NULL;
int i = 0;
for (i = 0; i < m_index; i++) {
pointer = m_table[i]->m_repid;
if (strcmp(pointer,rep_id) == 0)
break;
pointer = NULL;
}
if (pointer) {
// Anybody use return pointer (duplicate generates mem leak)
// return CORBA::TypeCode::_duplicate(m_table[i]->m_typecode);
return m_table[i]->m_typecode;
}
else {
if (m_index == m_max) {
m_cache** mtable = NULL;
m_max *= 2;
#if !defined(__linux__) && !defined(__sun)
mtable = (m_cache**) new m_cache*[m_max];
#else
mtable = new m_cache*[m_max];
#endif
memcpy(mtable, m_table, m_max/2*sizeof(m_cache*));
delete[] m_table;
m_table = mtable;
}
m_table[m_index] = new m_cache;
m_table[m_index]->m_repid = CORBA::string_dup(rep_id);
m_table[m_index++]->m_typecode = type; // Yet duplicate by caller
// m_table[m_index++]->m_typecode = CORBA::TypeCode::_duplicate(type);
// Anybody use return pointer (duplicate generates mem leak)
//return CORBA::TypeCode::_duplicate(type); // is leak if no catch ??
return type;
}
return NULL;
}
示例3: sizeof
// In this version of TAO typecodes are based on CDR, we have to
// verify that CDR offers the services needed for Typecode...
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
try
{
CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
static const CORBA::TypeCode_ptr tcs[]=
{
CORBA::_tc_null,
CORBA::_tc_void,
CORBA::_tc_short,
CORBA::_tc_long,
CORBA::_tc_ushort,
CORBA::_tc_ulong,
CORBA::_tc_float,
CORBA::_tc_double,
CORBA::_tc_boolean,
CORBA::_tc_char,
CORBA::_tc_octet,
CORBA::_tc_any,
CORBA::_tc_TypeCode,
CORBA::_tc_Principal,
CORBA::_tc_Object,
// CORBA::_tc_struct,
// CORBA::_tc_union,
// CORBA::_tc_enum,
CORBA::_tc_string,
// CORBA::_tc_sequence,
// CORBA::_tc_array,
// CORBA::_tc_alias,
// CORBA::_tc_except,
CORBA::_tc_longlong,
CORBA::_tc_ulonglong,
CORBA::_tc_longdouble,
CORBA::_tc_wchar,
CORBA::_tc_wstring,
CORBA::_tc_UNKNOWN,
CORBA::_tc_BAD_PARAM,
CORBA::_tc_NO_MEMORY,
CORBA::_tc_IMP_LIMIT,
CORBA::_tc_COMM_FAILURE,
CORBA::_tc_INV_OBJREF,
CORBA::_tc_OBJECT_NOT_EXIST,
CORBA::_tc_NO_PERMISSION,
CORBA::_tc_INTERNAL,
CORBA::_tc_MARSHAL,
CORBA::_tc_INITIALIZE,
CORBA::_tc_NO_IMPLEMENT,
CORBA::_tc_BAD_TYPECODE,
CORBA::_tc_BAD_OPERATION,
CORBA::_tc_NO_RESOURCES,
CORBA::_tc_NO_RESPONSE,
CORBA::_tc_PERSIST_STORE,
CORBA::_tc_BAD_INV_ORDER,
CORBA::_tc_TRANSIENT,
CORBA::_tc_FREE_MEM,
CORBA::_tc_INV_IDENT,
CORBA::_tc_INV_FLAG,
CORBA::_tc_INTF_REPOS,
CORBA::_tc_BAD_CONTEXT,
CORBA::_tc_OBJ_ADAPTER,
CORBA::_tc_DATA_CONVERSION,
CORBA::TypeCode::_tc_Bounds,
CORBA::TypeCode::_tc_BadKind
};
static int n = sizeof (tcs) / sizeof (tcs[0]);
for (const CORBA::TypeCode_ptr *i = tcs;
i != tcs + n;
++i)
{
CORBA::TypeCode_ptr tc = *i;
CORBA::TCKind k = tc->kind ();
switch (k)
{
case CORBA::tk_objref:
case CORBA::tk_struct:
case CORBA::tk_union:
case CORBA::tk_enum:
case CORBA::tk_alias:
case CORBA::tk_except:
{
const char *id = tc->id ();
const char *name = tc->name ();
CORBA::ULong length = 0;
// tc->length (TAO_TRY_ENV);
if (TAO_debug_level > 0)
{
ACE_DEBUG ((LM_DEBUG,
"ID = '%C'\n"
"%{%{ NAME = %C%$"
//.........这里部分代码省略.........
示例4: map_absolute_name
string
IDLBase::tcToName(CORBA::TypeCode_ptr type)
{
switch(type->kind())
{
case CORBA::tk_null:
return "";
break;
case CORBA::tk_void:
return "void";
break;
case CORBA::tk_short:
return "short";
break;
case CORBA::tk_long:
return "long";
break;
case CORBA::tk_longlong:
return "long long";
break;
case CORBA::tk_ushort:
return "unsigned short";
break;
case CORBA::tk_ulong:
return "unsigned long";
break;
case CORBA::tk_ulonglong:
return "unsigned long long";
break;
case CORBA::tk_float:
return "float";
break;
case CORBA::tk_double:
return "double";
break;
case CORBA::tk_longdouble:
return "long double";
break;
case CORBA::tk_boolean:
return "boolean";
break;
case CORBA::tk_char:
return "char";
break;
case CORBA::tk_wchar:
return "wchar";
break;
case CORBA::tk_octet:
return "octet";
break;
case CORBA::tk_any:
return "any";
break;
case CORBA::tk_TypeCode:
return "CORBA::TypeCode";
break;
case CORBA::tk_Principal:
return "CORBA::Principal";
break;
case CORBA::tk_fixed:
break;
case CORBA::tk_objref:
try {
return map_absolute_name(repository_->lookup_id(type->id()));
} catch (...) {
// CORBA::Object is not in the repository
// but it can be used as parameter
return "Object";
}
break;
case CORBA::tk_abstract_interface:
case CORBA::tk_local_interface:
case CORBA::tk_native:
case CORBA::tk_struct:
case CORBA::tk_except:
case CORBA::tk_union:
case CORBA::tk_enum:
case CORBA::tk_sequence:
case CORBA::tk_array:
case CORBA::tk_alias:
case CORBA::tk_value_box:
case CORBA::tk_value:
return map_absolute_name(repository_->lookup_id(type->id()));
break;
case CORBA::tk_string:
return "string";
break;
case CORBA::tk_wstring:
return "wstring";
break;
default:
std::cerr << "Unknown type code (" << (int)type->kind() << ")" << std::endl;
assert(false);
}
return "";
}