本文整理汇总了C++中corba::TypeCode_ptr类的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_ptr类的具体用法?C++ TypeCode_ptr怎么用?C++ TypeCode_ptr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TypeCode_ptr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ();
}
}
}
}
开发者ID:asdlei00,项目名称:ACE,代码行数:88,代码来源:Repository_i.cpp
示例2:
bool
TAO::TypeCode::Case<StringType, TypeCodeType>::equivalent (
CORBA::ULong index,
CORBA::TypeCode_ptr tc
) const
{
// Member names are ignore when determining equivalence.
// Check case TypeCodes.
CORBA::TypeCode_ptr const lhs_tc = this->type ();
CORBA::TypeCode_var const rhs_tc =
tc->member_type (index
);
CORBA::Boolean const equivalent_members =
lhs_tc->equivalent (rhs_tc.in ()
);
if (!equivalent_members)
return 0;
// Check case label.
// The label must be equal when determining equivalence, too.
return this->equal_label (index,
tc
);
}
开发者ID:asdlei00,项目名称:ACE,代码行数:27,代码来源:TypeCode_Case_Base_T.cpp
示例3: catch
CORBA::Boolean TIDorb::core::typecode::StructTypeCode::equal(CORBA::TypeCode_ptr tc) const
{
if (!ComplexTypeCode::equal(tc))
return false;
if (!m_exhaustive_equal)
return true;
try {
CORBA::ULong length = m_members->length();
if (length != tc->member_count())
return false;
for (CORBA::ULong i = 0; i < length; i++) {
if (strcmp(member_name(i), tc->member_name(i)))
return false;
if (! member_type(i)->equal(tc->member_type(i)))
return false;
}
// allright
return true;
} catch (const CORBA::TypeCode::BadKind& bk) {
return false;
} catch (const CORBA::TypeCode::Bounds& bn) {
return false;
}
}
开发者ID:AlvaroVega,项目名称:TIDorbC,代码行数:28,代码来源:StructTypeCode.C
示例4:
CORBA::Boolean
TAO::TypeCode::Enum<char const *,
char const * const *,
TAO::Null_RefCount_Policy>::equal_i (
CORBA::TypeCode_ptr tc
) const
{
// This call shouldn't throw since CORBA::TypeCode::equal() verified
// that the TCKind is the same as our's prior to invoking this
// method, meaning that member_count() is supported.
CORBA::ULong const tc_nenumerators =
tc->member_count ();
if (tc_nenumerators != this->nenumerators_)
return false;
for (CORBA::ULong i = 0; i < this->nenumerators_; ++i)
{
char const * const & lhs_enumerator = this->enumerators_[i];
char const * const lhs_name =
Traits<char const *>::get_string (lhs_enumerator);
char const * const rhs_name = tc->member_name (i);
if (ACE_OS::strcmp (lhs_name, rhs_name) != 0)
return false;
}
return true;
}
开发者ID:asdlei00,项目名称:ACE,代码行数:31,代码来源:Enum_TypeCode_Static.cpp
示例5:
void
TAO::TypeCode::Indirected_Type::set_recursive_tc (CORBA::TypeCode_ptr tc)
{
// link only once (should never happen that this is called twice but test anyway)
if (this->recursive_tc_ == 0)
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
if (tc == 0) // should never happen
return;
// make sure we are the right kind
CORBA::TCKind & mutable_kind = const_cast<CORBA::TCKind &> (this->kind_);
mutable_kind = tc->kind ();
// for every reference beside the master reference (1)
// increase the master tc's reference count to keep it
// safe while we're referenced outside the master's context
for (unsigned long cnt = this->refcount_; cnt > 1 ;--cnt)
{
tc->tao_duplicate ();
}
this->recursive_tc_ = tc;
}
}
开发者ID:CCJY,项目名称:ATCD,代码行数:26,代码来源:Indirected_Type_TypeCode.cpp
示例6:
CORBA::Boolean
TAO::TypeCode::Struct<char const *,
CORBA::TypeCode_ptr const *,
TAO::TypeCode::Struct_Field<char const *,
CORBA::TypeCode_ptr const *> const *,
TAO::Null_RefCount_Policy>::equivalent_i (
CORBA::TypeCode_ptr tc) const
{
// Perform a structural comparison, excluding the name() and
// member_name() operations.
CORBA::ULong const tc_nfields =
tc->member_count ();
if (tc_nfields != this->nfields_)
return false;
for (CORBA::ULong i = 0; i < this->nfields_; ++i)
{
CORBA::TypeCode_ptr const lhs =
Traits<char const *>::get_typecode (this->fields_[i].type);
CORBA::TypeCode_var const rhs =
tc->member_type (i);
CORBA::Boolean const equiv_members =
lhs->equivalent (rhs.in ());
if (!equiv_members)
return false;
}
return true;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:33,代码来源:Struct_TypeCode_Static.cpp
示例7: return
CORBA::Boolean
TAO::TypeCode::Fixed<RefCountPolicy>::equal_i (CORBA::TypeCode_ptr tc) const
{
// The following call won't throw since CORBA::TypeCode::equal() has
// already established the kind of tc is the same as our kind.
CORBA::UShort const tc_digits = tc->fixed_digits ();
CORBA::UShort const tc_scale = tc->fixed_scale ();
return (this->digits_ == tc_digits
&& this->scale_ == tc_scale);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:12,代码来源:Fixed_TypeCode.cpp
示例8:
CORBA::Boolean
TAO::TypeCode::Union<char const *,
CORBA::TypeCode_ptr const *,
TAO::TypeCode::Case<char const *,
CORBA::TypeCode_ptr const *> const * const *,
TAO::Null_RefCount_Policy>::equal_i (
CORBA::TypeCode_ptr tc
) const
{
// These calls shouldn't throw since CORBA::TypeCode::equal()
// verified that the TCKind is the same as our's prior to invoking
// this method, meaning that the CORBA::tk_union TypeCode methods
// are supported.
CORBA::ULong const tc_count = tc->member_count ();
CORBA::Long tc_def = tc->default_index ();
if (tc_count != this->ncases_ || tc_def != this->default_index_)
return false;
// Check the discriminator type.
CORBA::TypeCode_var tc_discriminator = tc->discriminator_type ();
CORBA::Boolean const equal_discriminators =
Traits<char const *>::get_typecode (this->discriminant_type_)->equal (
tc_discriminator.in ());
if (!equal_discriminators)
return false;
for (CORBA::ULong i = 0; i < this->ncases_; ++i)
{
if (this->default_index_ > -1
&& static_cast<CORBA::ULong> (this->default_index_) == i)
{
// Don't bother checking equality of default case label. It
// will always be the zero octet (the CDR encoded value is
// ignored).
continue;
}
case_type const & lhs_case = *this->cases_[i];
bool const equal_case = lhs_case.equal (i, tc);
if (!equal_case)
return false;
}
return true;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:52,代码来源:Union_TypeCode_Static.cpp
示例9: sizeof
bool
TAO::TypeCode::marshal (TAO_OutputCDR & cdr,
CORBA::TypeCode_ptr tc,
CORBA::ULong offset)
{
// Marshal the TypeCode TCKind and TypeCode body.
//
// Update the offset value in case a recursive TypeCode is being
// marshaled.
return
tc != 0
&& tc->tao_marshal_kind (cdr)
&& tc->tao_marshal (cdr, aligned_offset (offset) + sizeof (CORBA::ULong));
}
开发者ID:CCJY,项目名称:ATCD,代码行数:15,代码来源:TypeCode.cpp
示例10: while
CORBA::TypeCode_ptr
TAO::unaliased_typecode (CORBA::TypeCode_ptr tc)
{
if (CORBA::is_nil (tc))
{
throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 13, CORBA::COMPLETED_NO);
}
CORBA::TCKind tc_kind = tc->kind ();
if (tc_kind == CORBA::tk_alias)
{
CORBA::TypeCode_var tc_content = CORBA::TypeCode::_duplicate (tc);
// Iterate until we get to the actual unaliased type.
do
{
tc_content = tc_content->content_type ();
tc_kind = tc_content->kind ();
}
while (tc_kind == CORBA::tk_alias);
return tc_content._retn ();
}
return CORBA::TypeCode::_duplicate (tc);
}
开发者ID:CCJY,项目名称:ATCD,代码行数:28,代码来源:TypeCode.cpp
示例11: 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;
}
开发者ID:AlvaroVega,项目名称:TIDorbC,代码行数:59,代码来源:TypeCodeCache.C
示例12: return
CORBA::Boolean
TAO::TypeCode::String<RefCountPolicy>::equal_i (CORBA::TypeCode_ptr tc) const
{
// The following call won't throw since CORBA::TypeCode::equal() has
// already established the kind of tc is the same as our kind.
CORBA::ULong const tc_length = tc->length ();
return (this->length_ == tc_length);
}
开发者ID:CCJY,项目名称:ATCD,代码行数:9,代码来源:String_TypeCode.cpp
示例13:
CORBA::Boolean
TAO::TypeCode::Value<StringType,
TypeCodeType,
FieldArrayType,
RefCountPolicy>::equivalent_i (CORBA::TypeCode_ptr tc) const
{
CORBA::ValueModifier const tc_type_modifier =
tc->type_modifier ();
if (tc_type_modifier != this->type_modifier_)
return false;
CORBA::TypeCode_var rhs_concrete_base_type =
tc->concrete_base_type ();
CORBA::Boolean const equivalent_concrete_base_types =
this->equivalent (rhs_concrete_base_type.in ());
if (!equivalent_concrete_base_types)
return false;
// Perform a structural comparison, excluding the name() and
// member_name() operations.
CORBA::ULong const tc_nfields =
tc->member_count ();
if (tc_nfields != this->nfields_)
return false;
for (CORBA::ULong i = 0; i < this->nfields_; ++i)
{
Value_Field<StringType, TypeCodeType> const & lhs_field =
this->fields_[i];
CORBA::Visibility const lhs_visibility =
lhs_field.visibility;
CORBA::Visibility const rhs_visibility =
tc->member_visibility (i);
if (lhs_visibility != rhs_visibility)
return false;
CORBA::TypeCode_ptr const lhs_tc =
Traits<StringType>::get_typecode (lhs_field.type);
CORBA::TypeCode_var const rhs_tc =
tc->member_type (i);
CORBA::Boolean const equiv_types =
lhs_tc->equivalent (rhs_tc.in ()
);
if (!equiv_types)
return false;
}
return true;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:58,代码来源:Value_TypeCode.cpp
示例14: if
void
TAO::TypeCode::Indirected_Type::tao_release (void)
{
unsigned long newcount;
CORBA::TypeCode_ptr curmaster;
{
ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
newcount = --this->refcount_;
curmaster = this->recursive_tc_;
}
if (newcount >= 1 && curmaster)
{
curmaster->tao_release ();
}
else if (newcount == 0)
{
delete this;
}
}
开发者ID:CCJY,项目名称:ATCD,代码行数:20,代码来源:Indirected_Type_TypeCode.cpp
示例15: BAD_TYPECODE
DynArrayImpl::DynArrayImpl(DynamicAny::DynAnyFactory_ptr factory, TIDorb::core::TIDORB* orb,
CORBA::TypeCode_ptr type, CORBA::TypeCode_ptr real_type)
throw(CORBA::SystemException)
: DynComposite(factory, orb, type, real_type)
{
try {
_component_count = real_type->length();
} catch (const CORBA::TypeCode::BadKind& bk) {
throw CORBA::BAD_TYPECODE();
}
this->TIDThr::RefCounter::_add_ref();
}
开发者ID:AlvaroVega,项目名称:TIDorbC,代码行数:12,代码来源:DynArrayImpl.C
示例16:
CORBA::Boolean
TAO::TypeCode::Alias<StringType,
TypeCodeType,
RefCountPolicy>::equal_i (CORBA::TypeCode_ptr tc) const
{
// The CORBA::TypeCode base class already verified equality of the
// base attributes (id and name). Perform an equality comparison of
// the content.
CORBA::TypeCode_var rhs_content_type = tc->content_type ();
return
Traits<StringType>::get_typecode (this->content_type_)->equal (
rhs_content_type.in ());
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:15,代码来源:Alias_TypeCode.cpp
示例17: tab
void
DynAnyAnalyzer::analyze_basic_seq (CORBA::TypeCode_ptr tc,
DynamicAny::DynAny_ptr da)
{
CORBA::TypeCode_var ct = tc->content_type ();
CORBA::TCKind tk = ct->kind ();
tab (level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG,
"BASIC TYPE SEQUENCE\n"));
}
switch (tk)
{
CASEBS (boolean, Boolean, " Value (bool) = %d\n");
CASEBS (octet, Octet, " Value (octet) = %c\n");
CASEBS (char, Char, " Value (char) = %c\n");
CASEBS (wchar, WChar, " Value (wchar) = %u\n");
CASEBS (short, Short, " Value (short) = %d\n");
CASEBS (ushort, UShort, " Value (ushort) = %u\n");
CASEBS (long, Long, " Value (long) = %d\n");
CASEBS (ulong, ULong, " Value (ulong) = %u\n");
CASEBS (longlong, LongLong, " Value (longlong) = %Ld\n");
CASEBS (ulonglong, ULongLong, " Value (ulonglong) = %Lu\n");
CASEBS (float, Float, " Value (float) = %f\n");
CASEBS (double, Double, " Value (double) = %f\n");
case CORBA::tk_longdouble:
default:
tab (level_);
if (debug_)
{
ACE_DEBUG ((LM_DEBUG,
" unhandled typecode = %d\n",
static_cast<int> (tk)));
}
break;
}
}
开发者ID:chenbk85,项目名称:ACE-Middleware,代码行数:43,代码来源:analyzer.cpp
示例18: BAD_TYPECODE
DynStructImpl::DynStructImpl(DynamicAny::DynAnyFactory_ptr factory,
TIDorb::core::TIDORB* orb,
CORBA::TypeCode_ptr type,
CORBA::TypeCode_ptr real_type)
throw(CORBA::SystemException)
: DynComposite(factory, orb, type, real_type)
{
try
{
_component_count = real_type->member_count();
}
catch(CORBA::TypeCode::BadKind)
{
throw CORBA::BAD_TYPECODE();
}
_current = (_component_count == 0) ? -1 : 0;
this->TIDThr::RefCounter::_add_ref();
}
开发者ID:AlvaroVega,项目名称:TIDorbC,代码行数:20,代码来源:DynStructImpl.C
示例19: in_cdr
bool
TAO::TypeCode::Case_Enum_T<StringType,
TypeCodeType>::equal_label (::CORBA::ULong index,
::CORBA::TypeCode_ptr tc) const
{
CORBA::Any_var any = tc->member_label (index);
TAO_OutputCDR out_cdr;
if (! any->impl ()->marshal_value (out_cdr))
{
return false;
}
TAO_InputCDR in_cdr (out_cdr);
CORBA::ULong tc_label = ACE_UINT32_MAX;
if (! in_cdr.read_ulong (tc_label))
{
return false;
}
return (this->label_ == tc_label);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:23,代码来源:TypeCode_Case_Enum_T.cpp
示例20:
CORBA::Boolean
TAO::TypeCode::Value<char const *,
CORBA::TypeCode_ptr const *,
TAO::TypeCode::Value_Field<char const *,
CORBA::TypeCode_ptr const *> const *,
TAO::Null_RefCount_Policy>::equal_i (
CORBA::TypeCode_ptr tc) const
{
// None of these calls should throw since CORBA::TypeCode::equal()
// verified that the TCKind is the same as our's prior to invoking
// this method.
CORBA::ValueModifier const tc_type_modifier =
tc->type_modifier ();
if (tc_type_modifier != this->type_modifier_)
return false;
CORBA::TypeCode_var rhs_concrete_base_type = tc->concrete_base_type ();
CORBA::Boolean const equal_concrete_base_types =
this->equal (rhs_concrete_base_type.in ());
if (!equal_concrete_base_types)
return false;
CORBA::ULong const tc_nfields = tc->member_count ();
if (tc_nfields != this->nfields_)
return false;
for (CORBA::ULong i = 0; i < this->nfields_; ++i)
{
Value_Field<char const *, CORBA::TypeCode_ptr const *> const & lhs_field =
this->fields_[i];
CORBA::Visibility const lhs_visibility = lhs_field.visibility;
CORBA::Visibility const rhs_visibility = tc->member_visibility (i);
if (lhs_visibility != rhs_visibility)
return false;
char const * const lhs_name =
Traits<char const *>::get_string (lhs_field.name);;
char const * const rhs_name = tc->member_name (i);
if (ACE_OS::strcmp (lhs_name, rhs_name) != 0)
return false;
CORBA::TypeCode_ptr const lhs_tc =
Traits<char const *>::get_typecode (lhs_field.type);
CORBA::TypeCode_var const rhs_tc =
tc->member_type (i);
CORBA::Boolean const equal_members =
lhs_tc->equal (rhs_tc.in ());
if (!equal_members)
return false;
}
return true;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:63,代码来源:Value_TypeCode_Static.cpp
注:本文中的corba::TypeCode_ptr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论