本文整理汇总了C++中corba::TypeCode_var::name方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeCode_var::name方法的具体用法?C++ TypeCode_var::name怎么用?C++ TypeCode_var::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::TypeCode_var
的用法示例。
在下文中一共展示了TypeCode_var::name方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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());
}
示例2:
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;
}
示例3: push_structured_event
virtual void push_structured_event(CosNotification::StructuredEvent const& event)
throw(CosEventComm::Disconnected)
{
cout << "domain_name: " << event.header.fixed_header.event_type.domain_name
<< " type_name: " << event.header.fixed_header.event_type.type_name << " " << flush;
if (false) {
Miro::Client client;
DynamicAny::DynAnyFactory_var daf =
client.resolveInit<DynamicAny::DynAnyFactory>("DynAnyFactory");
DynamicAny::DynAny_var da = daf->create_dyn_any(event.remainder_of_body);
CORBA::TypeCode_var tc = da->type();
if (tc->kind() == CORBA::tk_struct) {
CORBA::String_var name = tc->name();
CORBA::String_var id = tc->id();
DynamicAny::DynStruct_var ds =
DynamicAny::DynStruct::_narrow(da);
for (CORBA::ULong i = 0; i < ds->component_count(); ++i) {
DynamicAny::DynAny_var member = ds->current_component();
CORBA::String_var name = ds->current_member_name();
if (std::string("timestamp") == name.in()) {
long long int i = member->get_ulonglong();
ACE_Time_Value t;
ORBSVCS_Time::Absolute_TimeT_to_Time_Value(t, i);
cout << "latency: " << ACE_OS::gettimeofday() - t << endl;
break;
}
ds->next();
}
}
else {
cerr << "unknown event layout" << endl;
}
}
ACE_Time_Value t;
t.set(time_out);
ACE_OS::sleep(t);
cout << "waking up after sleep" << endl;
}
示例4: lit
int
TAO_Log_Constraint_Visitor::visit_special (ETCL_Special *special)
{
try
{
CORBA::TypeCode_var tc = this->current_member_->type ();
switch (special->type ())
{
case ETCL_LENGTH:
{
// If the TCKind is not a sequence or an array, the
// call to length() will raise an exception, and the
// catch block will return -1;
CORBA::ULong length = tc->length ();
TAO_ETCL_Literal_Constraint lit (length);
this->queue_.enqueue_head (lit);
return 0;
}
case ETCL_DISCRIMINANT:
{
// If the TCKind is not a union, the
// call to init() will raise an exception, and the
// catch block will return -1;
TAO_DynUnion_i dyn_union;
dyn_union.init (this->current_member_.in ());
DynamicAny::DynAny_var disc =
dyn_union.get_discriminator ();
CORBA::Any_var disc_any = disc->to_any ();
TAO_ETCL_Literal_Constraint lit (disc_any.ptr ());
this->queue_.enqueue_head (lit);
return 0;
}
case ETCL_TYPE_ID:
{
const char *name = tc->name ();
TAO_ETCL_Literal_Constraint lit (name);
this->queue_.enqueue_head (lit);
return 0;
}
case ETCL_REPOS_ID:
{
const char *id = tc->id ();
TAO_ETCL_Literal_Constraint lit (id);
this->queue_.enqueue_head (lit);
return 0;
}
default:
return -1;
}
}
catch (const CORBA::Exception&)
{
return -1;
}
}