本文整理汇总了C++中corba::TypeCode_var::in方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var::in方法的具体用法?C++ TypeCode_var::in怎么用?C++ TypeCode_var::in使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::TypeCode_var
的用法示例。
在下文中一共展示了TypeCode_var::in方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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;
}
示例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:
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 ());
}
示例5: 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)
示例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:
bool
TAO::TypeCode::Case<StringType, TypeCodeType>::equal (CORBA::ULong index,
CORBA::TypeCode_ptr tc
) const
{
// Check case names.
char const * const lhs_name = this->name ();
char const * const rhs_name = tc->member_name (index
);
if (ACE_OS::strcmp (lhs_name, rhs_name) != 0)
return false;
// Check case TypeCodes.
CORBA::TypeCode_ptr const lhs_tc = this->type ();
CORBA::TypeCode_var const rhs_tc =
tc->member_type (index
);
CORBA::Boolean const equal_members =
lhs_tc->equal (rhs_tc.in ()
);
if (!equal_members)
return false;
// Check case label.
return this->equal_label (index,
tc
);
}
示例8:
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_ );
}
}
示例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: element
CORBA::Boolean
TAO_Log_Constraint_Visitor::struct_does_contain (
const CORBA::Any *any,
TAO_ETCL_Literal_Constraint &item
)
{
try
{
TAO_DynStruct_i dyn_struct;
dyn_struct.init (*any);
DynamicAny::NameValuePairSeq_var members =
dyn_struct.get_members ();
CORBA::ULong length = members->length ();
CORBA::TypeCode_var tc;
CORBA::TCKind kind;
for (CORBA::ULong i = 0; i < length; ++i)
{
tc = members[i].value.type ();
kind = TAO_DynAnyFactory::unalias (tc.in ());
// The literal and the struct member must be
// of the same simple type.
CORBA::Boolean match = this->simple_type_match (item.expr_type (),
kind);
if (!match)
{
return false;
}
TAO_ETCL_Literal_Constraint element (&members[i].value);
if (item == element)
{
return true;
}
}
}
catch (const CORBA::Exception&)
{
return false;
}
return false;
}
示例14: rCORBA_Request_exceptions
VALUE rCORBA_Request_exceptions(VALUE self)
{
CORBA::Request_ptr _req = r2tao_Request_r2t(self);
R2TAO_TRY
{
CORBA::ORB_var _orb = _req->target ()->_get_orb ();
CORBA::ULong exc_len = _req->exceptions ()->count ();
VALUE rexc = rb_ary_new ();
for (CORBA::ULong x=0; x<exc_len ;++x)
{
CORBA::TypeCode_var xtc = _req->exceptions ()->item (x);
VALUE x_rtc = r2tao_Typecode_t2r(xtc.in (), _orb.in ());
rb_ary_push (rexc, x_rtc);
}
return rexc;
}
R2TAO_CATCH;
return Qnil;
}
示例15: NowSeenThis
CORBA::TypeCode_ptr
TAO_UnionDef_i::type_i (void)
{
ACE_TString id;
this->repo_->config ()->get_string_value (this->section_key_,
"id",
id);
//---------------------------------------------------------------------------
// Have we already seen this union definition at an outer scope?
// If yes, return a recursive type code to signal the nesting.
// If not, record this new union id in our stack (it will automatically be
// removed when NowSeenThis goes out of scope).
//---------------------------------------------------------------------------
if (TAO_RecursiveDef_OuterScopes::SeenBefore( id ))
return this->repo_->tc_factory ()->
create_recursive_tc ( id.c_str ());
TAO_RecursiveDef_OuterScopes NowSeenThis( id );
//---------------------------------------------------------------------------
// Create a new type code for this structure; the create_union_tc() call
// that follows may recursivly call this method again if one of its children
// refers to a union (which is the point of the above NowSeenThis stack).
//---------------------------------------------------------------------------
ACE_TString name;
this->repo_->config ()->get_string_value (this->section_key_,
"name",
name);
CORBA::TypeCode_var tc = this->discriminator_type_i ();
CORBA::UnionMemberSeq_var members = this->members_i ();
return this->repo_->tc_factory ()->create_union_tc (id.c_str (),
name.c_str (),
tc.in (),
members.in ());
}