本文整理汇总了C++中DataType::alias_p方法的典型用法代码示例。如果您正苦于以下问题:C++ DataType::alias_p方法的具体用法?C++ DataType::alias_p怎么用?C++ DataType::alias_p使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataType
的用法示例。
在下文中一共展示了DataType::alias_p方法的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 ();
}
示例2: extract_into_dynany
//.........这里部分代码省略.........
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);
case TCKind::tk_sequence_l:
return DynSequence_Handler::extract_into_dynany (type, value);
case TCKind::tk_struct_l:
return DynStruct_Handler::extract_into_dynany (type, value);
case TCKind::tk_alias_l:
return DynAlias_Handler::extract_into_dynany (type, value);
case TCKind::tk_longdouble_l:
case TCKind::tk_wstring_l:
case TCKind::tk_wfixed_l:
case TCKind::tk_any_l:
case TCKind::tk_TypeCode_l:
case TCKind::tk_Principal_l:
case TCKind::tk_objref_l:
case TCKind::tk_union_l:
case TCKind::tk_array_l:
case TCKind::tk_except_l:
case TCKind::tk_value_l:
case TCKind::tk_value_box_l:
case TCKind::tk_native_l:
case TCKind::tk_abstract_interface_l:
case TCKind::tk_local_interface_l:
case TCKind::tk_component_l:
case TCKind::tk_home_l:
case TCKind::tk_event_l:
DANCE_DEBUG (DANCE_LOG_TERMINAL_ERROR,
(LM_ERROR, "Type not supported\n"));
throw Config_Error ("", "Type not supported");
}
*/
// retval->assign (alias);
// return retval._retn ();
}
catch (const DynamicAny::DynAny::InvalidValue&)
{
DANCE_DEBUG (DANCE_LOG_TERMINAL_ERROR,
(LM_ERROR,
ACE_TEXT ("Invalid value provided in XML when trying to ")
ACE_TEXT ("initialize an instance of enumerated type %s\n"),
type.alias ().typeId ().c_str ()));
throw Config_Error (type.alias ().typeId (),
ACE_TEXT ("Invalid value provided in XML"));
}
catch (Config_Error &ex)
{
DANCE_DEBUG (DANCE_LOG_TERMINAL_ERROR,
(LM_ERROR, ACE_TEXT ("DynAlias_Handler caught Config_Error\n")));
if (type.alias_p ())
ex.add_name (type.alias ().typeId ());
throw ex;
}
catch (...)
{
DANCE_DEBUG (DANCE_LOG_TERMINAL_ERROR, (LM_ERROR,
ACE_TEXT ("DynAlias_Handler caught unknown exception\n")));
throw Config_Error (type.alias ().typeId (),
ACE_TEXT ("Unknown exception"));
}
}