本文整理汇总了C++中corba::TypeCode_var类的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var类的具体用法?C++ TypeCode_var怎么用?C++ TypeCode_var使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TypeCode_var类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
TAO_DynArray_i::init (CORBA::TypeCode_ptr tc)
{
CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc);
if (kind != CORBA::tk_array)
{
throw DynamicAny::DynAnyFactory::InconsistentTypeCode ();
}
this->type_ = CORBA::TypeCode::_duplicate (tc);
CORBA::ULong numfields = this->get_tc_length (tc);
// Resize the array.
this->da_members_.size (numfields);
this->init_common ();
CORBA::TypeCode_var elemtype = this->get_element_type ();
for (CORBA::ULong i = 0; i < numfields; ++i)
{
// Recursively initialize each element.
this->da_members_[i] =
TAO::MakeDynAnyUtils::make_dyn_any_t<CORBA::TypeCode_ptr> (
elemtype.in (),
elemtype.in (),
this->allow_truncation_ );
}
}
示例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
);
}
示例3:
void
TAO_DynEnum_i::set_as_string (const char *value_as_string)
{
CORBA::TypeCode_var ct = TAO_DynAnyFactory::strip_alias (this->type_.in ());
CORBA::ULong count = ct.in ()->member_count ();
CORBA::ULong i;
const char *temp = 0;
for (i = 0; i < count; ++i)
{
temp = ct.in ()->member_name (i);
if (!ACE_OS::strcmp (value_as_string, temp))
{
break;
}
}
if (i < count)
{
this->value_ = i;
}
else
{
throw DynamicAny::DynAny::InvalidValue ();
}
}
示例4: rCORBA_Request_arguments
VALUE rCORBA_Request_arguments(VALUE self)
{
CORBA::Request_ptr _req = r2tao_Request_r2t(self);
R2TAO_TRY
{
CORBA::ULong arg_len = _req->arguments ()->count ();
VALUE rargs = rb_ary_new ();
for (CORBA::ULong a=0; a<arg_len ;++a)
{
VALUE rarg = rb_ary_new ();
CORBA::NamedValue_ptr arg = _req->arguments ()->item (a);
rb_ary_push (rarg, rb_str_new2 (arg->name ()));
if (ACE_BIT_ENABLED (arg->flags (), CORBA::ARG_IN))
rb_ary_push (rarg, ULONG2NUM (r2tao_IN_ARG));
else if (ACE_BIT_ENABLED (arg->flags (), CORBA::ARG_OUT))
rb_ary_push (rarg, ULONG2NUM (r2tao_OUT_ARG));
else if (ACE_BIT_ENABLED (arg->flags (), CORBA::ARG_INOUT))
rb_ary_push (rarg, ULONG2NUM (r2tao_INOUT_ARG));
CORBA::TypeCode_var atc = arg->value ()->type ();
VALUE arg_rtc = r2tao_Typecode_t2r(atc.in (), _req->target ()->_get_orb ());
rb_ary_push (rarg, arg_rtc);
VALUE arg_val = r2tao_Typecode_Any2Ruby (*arg->value (), atc.in (),
arg_rtc, arg_rtc,
_req->target ()->_get_orb ());
rb_ary_push (rarg, arg_val);
rb_ary_push (rargs, rarg);
}
return rargs;
}
R2TAO_CATCH;
return Qnil;
}
示例5:
CORBA::TypeCode_ptr
TAO_ValueBoxDef_i::type_i (void)
{
ACE_TString id;
this->repo_->config ()->get_string_value (this->section_key_,
"id",
id);
ACE_TString name;
this->repo_->config ()->get_string_value (this->section_key_,
"name",
name);
ACE_TString boxed_type_path;
this->repo_->config ()->get_string_value (this->section_key_,
"boxed_type",
boxed_type_path);
TAO_IDLType_i *impl =
TAO_IFR_Service_Utils::path_to_idltype (boxed_type_path,
this->repo_);
CORBA::TypeCode_var tc = impl->type_i ();
return this->repo_->tc_factory ()->create_value_box_tc (id.c_str (),
name.c_str (),
tc.in ());
}
示例6: Config_Error
CORBA::TypeCode_ptr
DynAlias_Handler::create_typecode (const DataType &type)
{
DANCE_TRACE("DynAlias_Handler::create_typecode");
if (!type.alias_p ())
{
DANCE_DEBUG (DANCE_LOG_TERMINAL_ERROR,
(LM_ERROR, ACE_TEXT ("ERROR: Alias type description required")));
throw Config_Error (ACE_TEXT (""),
ACE_TEXT ("Did not find expected alias type description, tk_kind"\
"may be wrong."));
}
CORBA::TypeCode_var tc =
DYNANY_HANDLER->orb ()->create_alias_tc
(ACE_TEXT_ALWAYS_CHAR (type.alias ().typeId ().c_str ()),
ACE_TEXT_ALWAYS_CHAR (type.alias ().name ().c_str ()),
DYNANY_HANDLER->create_typecode (type.alias ().elementType ()));
DYNANY_HANDLER->register_typecode (type.alias ().typeId (),
tc.in ());
return tc._retn ();
}
示例7: if
TAO_Literal_Constraint::
TAO_Literal_Constraint (CORBA::Any* any)
{
CORBA::Any& any_ref = *any;
CORBA::TypeCode_var type = any_ref.type ();
// @@ No where to throw exception back.
CORBA::TCKind corba_type = CORBA::tk_null;
try
{
corba_type = type->kind ();
}
catch (const CORBA::Exception&)
{
// @@ Seth: Don't know what else to do. Make sure we can tell
// when this constructor fails.
return;
}
this->type_ = TAO_Literal_Constraint::comparable_type (type.in ());
switch (this->type_)
{
case TAO_SIGNED:
this->op_.integer_ = 0;
if (corba_type == CORBA::tk_short)
{
CORBA::Short sh;
any_ref >>= sh;
this->op_.integer_ = static_cast<CORBA::LongLong> (sh);
}
else if (corba_type == CORBA::tk_long)
示例8: ToString
//-----------------------------------------------------------------------------//
std::string CCorbaErrorHelper::ToString(const CORBA::Exception& err)
{
CORBA::Any tmp;
tmp <<= err;
CORBA::TypeCode_var tc = tmp.type();
return std::string(tc->name());
}
示例9:
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;
}
示例10: OBJECT_NOT_EXIST
CORBA::TypeCode_ptr
TAO_AliasDef_i::type_i (void)
{
ACE_TString id;
this->repo_->config ()->get_string_value (this->section_key_,
ACE_TEXT("id"),
id);
ACE_TString name;
this->repo_->config ()->get_string_value (this->section_key_,
ACE_TEXT("name"),
name);
ACE_TString original_type;
this->repo_->config ()->get_string_value (this->section_key_,
ACE_TEXT("original_type"),
original_type);
TAO_IDLType_i *impl =
TAO_IFR_Service_Utils::path_to_idltype (original_type,
this->repo_);
if (0 == impl)
{
throw CORBA::OBJECT_NOT_EXIST();
}
CORBA::TypeCode_var tc = impl->type_i ();
return this->repo_->tc_factory ()->create_alias_tc (id.c_str (),
name.c_str (),
tc.in ());
}
示例11:
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;
}
示例12: string_dup
char *
TAO_DynEnum_i::get_as_string (void)
{
CORBA::TypeCode_var ct = TAO_DynAnyFactory::strip_alias (this->type_.in ());
const char *retval = ct.in ()->member_name (this->value_);
return CORBA::string_dup (retval);
}
示例13:
//----------------------------------------------------------------------
CORBA::TCKind
AnyAide::getRealType(const CORBA::Any& any)
{
//have to create an _var type because this is actually a CORBA object
CORBA::TypeCode_var tc;
//get the type from the any
tc = any.type();
//return the kind...simple enough.
return tc->kind();
}
示例14: BAD_INV_ORDER
CORBA::TypeCode_ptr
AliasDef_impl::type
()
throw(CORBA::SystemException)
{
DEBUG_OUTLINE ( "AliasDef_impl::type() called" );
vector < Contained_impl* > helper_seq;
CORBA::TypeCode_var tc = build_recursive_type_code(helper_seq);
if ( helper_seq.size() != 0 )
throw CORBA::BAD_INV_ORDER(); // Is this correct?
return tc._retn();
}
示例15:
static ostream &
operator<< (ostream & os, const CORBA::Exception & e)
{
CORBA::Any tmp;
tmp <<= e;
CORBA::TypeCode_var tc = tmp.type ();
const char * p = tc->name ();
if (*p != '\0')
os << p;
else
os << tc->id ();
return os;
}