当前位置: 首页>>代码示例>>C++>>正文


C++ DataType::alias方法代码示例

本文整理汇总了C++中DataType::alias方法的典型用法代码示例。如果您正苦于以下问题:C++ DataType::alias方法的具体用法?C++ DataType::alias怎么用?C++ DataType::alias使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataType的用法示例。


在下文中一共展示了DataType::alias方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: extract_into_dynany

    DynamicAny::DynAny_ptr
    DynAlias_Handler::extract_into_dynany (const DataType &type,
                                           const DataValue &value,
                                           CORBA::TypeCode_ptr req_tc)
    {
      DANCE_TRACE("DynAlias_Handler::extract_into_dynany");

      try
        {
          CORBA::TypeCode_var tc;

          if (req_tc)
            tc = req_tc;
          else
            tc = DynAlias_Handler::create_typecode (type);

          // Make the actual DynAlias
          //          DynamicAny::DynAny_var retval =
          //DYNANY_HANDLER->daf ()->create_dyn_any_from_type_code (tc);
          //          DynamicAny::DynAlias_var retval =
          //            DynamicAny::DynAlias::_narrow (temp.in ());

          DynamicAny::DynAny_var alias = DYNANY_HANDLER->extract_into_dynany (
            type.alias ().elementType (), value, tc);
          return alias._retn ();
          /*
          switch (type.kind ().integral ())
            {
              // ========== BASIC TYPES
            case TCKind::tk_null_l:
            case TCKind::tk_void_l:
              DANCE_DEBUG (DANCE_LOG_TERMINAL_ERROR,
                (LM_WARNING, "I don't know how to handle null or
              void types\n"));

            case TCKind::tk_short_l:
              retval->insert_short (CORBA::Short (static_cast <
                ::XMLSchema::short_ const & > (*value.begin_short ())));
              break;

            case TCKind::tk_long_l:
              retval->insert_long (CORBA::Long (static_cast <
                ::XMLSchema::int_ const& > (*value.begin_long ())));
              break;

            case TCKind::tk_ushort_l:
              retval->insert_ushort (CORBA::UShort (static_cast<
                ::XMLSchema::unsignedShort const & > (*value.begin_ushort ())));
              break;

            case TCKind::tk_ulong_l:
              retval->insert_ulong (CORBA::ULong (static_cast <
                ::XMLSchema::unsignedInt const& > (*value.begin_ulong ())));
              break;

            case TCKind::tk_float_l:
              retval->insert_float (CORBA::Float (*value.begin_float ()));
              break;

            case TCKind::tk_double_l:
              retval->insert_double (CORBA::Double (*value.begin_double ()));
              break;

            case TCKind::tk_boolean_l:
              retval->insert_boolean (static_cast <
                ::XMLSchema::boolean const& > (*value.begin_boolean ()));
              break;

            case TCKind::tk_char_l:
              retval->insert_char (CORBA::Char (
                *value.begin_string ()->c_str ()));
              break;

            case TCKind::tk_octet_l:
              retval->insert_octet (static_cast <
                const unsigned char &> (*value.begin_octet ()));
              break;

            case TCKind::tk_string_l:
              retval->insert_string (value.begin_string ()->c_str ());
              break;

            case TCKind::tk_longlong_l:
              retval->insert_longlong (CORBA::LongLong (static_cast <
                ::XMLSchema::long_ const& > (*value.begin_longlong ())));
              break;

            case TCKind::tk_ulonglong_l:
              retval->insert_ulonglong (CORBA::ULongLong (static_cast <
                ::XMLSchema::unsignedLong const& > (
                  *value.begin_ulonglong ())));
              break;

            case TCKind::tk_wchar_l:
              retval->insert_wchar (CORBA::WChar (
                *value.begin_string ()->c_str ()));
              break;

        case TCKind::tk_enum_l:
          return DynEnum_Handler::extract_into_dynany (type, value);
//.........这里部分代码省略.........
开发者ID:molixiaoge,项目名称:ACE,代码行数:101,代码来源:DynAlias_Handler.cpp


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