• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ corba::TypeCode_var类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中corba::TypeCode_var的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var类的具体用法?C++ TypeCode_var怎么用?C++ TypeCode_var使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TypeCode_var类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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_ );
    }
}
开发者ID:CCJY,项目名称:ATCD,代码行数:31,代码来源:DynArray_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:

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 ();
    }
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:29,代码来源:DynEnum_i.cpp


示例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;
}
开发者ID:noda50,项目名称:RubyItk,代码行数:33,代码来源:object.cpp


示例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 ());
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:28,代码来源:ValueBoxDef_i.cpp


示例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 ();
    }
开发者ID:molixiaoge,项目名称:ACE,代码行数:25,代码来源:DynAlias_Handler.cpp


示例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)
开发者ID:CCJY,项目名称:ATCD,代码行数:30,代码来源:Constraint_Nodes.cpp


示例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());
}
开发者ID:AlexS2172,项目名称:IVRMstandard,代码行数:8,代码来源:CorbaErrorHelper.cpp


示例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;
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:33,代码来源:Struct_TypeCode_Static.cpp


示例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 ());
}
开发者ID:asdlei00,项目名称:ACE,代码行数:32,代码来源:AliasDef_i.cpp


示例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;
}
开发者ID:CCJY,项目名称:ATCD,代码行数:58,代码来源:Value_TypeCode.cpp


示例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);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:9,代码来源:DynEnum_i.cpp


示例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();
}
开发者ID:ACS-Community,项目名称:ACS,代码行数:12,代码来源:acsutilAnyAide.cpp


示例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();
}
开发者ID:BackupTheBerlios,项目名称:qedo-svn,代码行数:13,代码来源:AliasDef_impl.cpp


示例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;
}
开发者ID:asdlei00,项目名称:ACE,代码行数:13,代码来源:server.cpp


示例16: while

// Get the length from the (possibly aliased) typecode.
CORBA::ULong
TAO_DynArray_i::get_tc_length (CORBA::TypeCode_ptr tc)
{
  CORBA::TypeCode_var tctmp = CORBA::TypeCode::_duplicate (tc);
  CORBA::TCKind kind = tctmp->kind ();

  while (kind == CORBA::tk_alias)
    {
      tctmp = tctmp->content_type ();
      kind = tctmp->kind ();
    }

  return tctmp->length ();
}
开发者ID:CCJY,项目名称:ATCD,代码行数:15,代码来源:DynArray_i.cpp


示例17: 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;
}
开发者ID:binary42,项目名称:OCI,代码行数:48,代码来源:Log_Constraint_Visitors.cpp


示例18: ForwardRequest

void
Client_Request_Interceptor::receive_exception (
    PortableInterceptor::ClientRequestInfo_ptr ri)
{
  ++this->exception_count_;
  ACE_DEBUG ((LM_DEBUG, "received exception %d\n",
              this->exception_count_));
  if (CORBA::is_nil (this->orb_.in ()))
  {
    int argc = 0;
    ACE_TCHAR **argv = 0;
    this->orb_ = CORBA::ORB_init (argc, argv, this->orb_id_.in ());
  }

  if (this->exception_count_ == 1)
    {
      ACE_DEBUG ((LM_DEBUG, "forwarding client to the second server\n"));
      CORBA::Object_var first_forward =
        this->orb_->string_to_object (this->first_forward_str_.in ());

      // Notice that this is not a permanent forward.
      throw PortableInterceptor::ForwardRequest (first_forward.in ());
    }
  else if (this->exception_count_ == 2)
    {
      ACE_DEBUG ((LM_DEBUG, "forwarding client to the third server\n"));
      CORBA::Object_var second_forward =
        this->orb_->string_to_object (this->second_forward_str_.in ());

      // Notice that this is not a permanent forward.
      throw PortableInterceptor::ForwardRequest (second_forward.in ());
    }
  else if (this->exception_count_ == 3)
    {
      CORBA::Any_var ex = ri->received_exception ();

      CORBA::TypeCode_var tc;
      const char * id = 0;
      tc = ex->type ();
      id = tc->id ();

      if (ACE_OS_String::strcmp (id,
                                 "IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)
          throw ::CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
    }
}
开发者ID:asdlei00,项目名称:ACE,代码行数:46,代码来源:Client_Request_Interceptor.cpp


示例19: throw

/* execute *****************************************************************
    - executes a process on the device
************************************************************************* */
CF::ExecutableDevice::ProcessID_Type ExecutableDevice_impl::execute (
    const char* name, 
    const CF::Properties& options, 
    const CF::Properties& parameters) 
        throw (CORBA::SystemException, 
                CF::Device::InvalidState, 
                CF::ExecutableDevice::InvalidFunction, 
                CF::ExecutableDevice::InvalidParameters, 
                CF::ExecutableDevice::InvalidOptions, 
                CF::InvalidFileName, 
                CF::ExecutableDevice::ExecuteFail)
{
    CORBA::TypeCode_var tc;                       // CORBA type code
    const char* tempStr;                          // temporary character string
    CF::ExecutableDevice::ProcessID_Type PID;     // process ID
    int size = 2 * parameters.length () + 2;      // length of the POSIX argv arguments
    char** argv = new char *[size];               // POSIX arguments
    CORBA::ULong stackSize, priority;             // CORBA unsigned longs for options storage

    // verify device is in the correct state
    if (!isUnlocked () || isDisabled ()) {
        DEBUG(5, ExecutableDevice_impl, "Cannot execute. System is either LOCKED, SHUTTING DOWN or DISABLED.")
        throw (CF::Device::InvalidState("Cannot execute. System is either LOCKED, SHUTTING DOWN or DISABLED."));
    }

    priority = 0;                                 // this is the default value for the priority (it's actually meaningless in this version)
    stackSize = 4096;                             // this is the default value for the stacksize (it's actually meaningless in this version)

    {
    // verify valid options, both STACK_SIZE_ID and PRIORITY_ID must have unsigned-long types
    CF::Properties invalidOptions;
    invalidOptions.length(0);

    for (unsigned i = 0; i < options.length (); i++) {
        tc = options[i].value.type ();

        // extract priority and stack size from the options list
        if (strcmp (options[i].id, CF::ExecutableDevice::PRIORITY_ID)) {
            if (tc->kind () == CORBA::tk_ulong) {
                options[i].value >>= priority; 
            } else {
                LOG_ERROR(ExecutableDevice_impl, "Incorrect type provided for option PRIORITY");
                invalidOptions.length(invalidOptions.length() + 1);
                invalidOptions[invalidOptions.length() - 1] = options[i];
            }
        } else if (strcmp (options[i].id, CF::ExecutableDevice::STACK_SIZE_ID)) {
开发者ID:Axios-Engineering,项目名称:framework-core,代码行数:49,代码来源:ExecutableDevice_impl.cpp


示例20: current_member_kind

CORBA::TCKind DynStructImpl::current_member_kind()
   throw(DynamicAny::DynAny::TypeMismatch,
         DynamicAny::DynAny::InvalidValue, CORBA::SystemException)
{
   if (_destroyed)
   {
      throw CORBA::OBJECT_NOT_EXIST("DynAny destroyed");
   }

   if (_current == -1)
   {
      throw DynamicAny::DynAny::InvalidValue(); // "No member (current = -1)"
   }

   CORBA::TypeCode_var type = _base_type->member_type(_current);
   return type->kind();
}
开发者ID:AlvaroVega,项目名称:TIDorbC,代码行数:17,代码来源:DynStructImpl.C



注:本文中的corba::TypeCode_var类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ core::ActionContainer类代码示例发布时间:2022-05-31
下一篇:
C++ corba::TypeCode_ptr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap