本文整理汇总了C++中CorbaTypeTransporter::updateFromAny方法的典型用法代码示例。如果您正苦于以下问题:C++ CorbaTypeTransporter::updateFromAny方法的具体用法?C++ CorbaTypeTransporter::updateFromAny怎么用?C++ CorbaTypeTransporter::updateFromAny使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CorbaTypeTransporter
的用法示例。
在下文中一共展示了CorbaTypeTransporter::updateFromAny方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
bool execute() {
try {
if (mdocall) {
CORBA::Any_var any = mfact->callOperation( mop.c_str(), nargs.inout() );
for (size_t i=0; i < margs.size(); ++i ) {
const types::TypeInfo* ti = margs[i]->getTypeInfo();
CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) );
assert( ctt );
ctt->updateFromAny( &nargs[i], margs[i] );
}
// convert returned any to local type:
if (mctt)
return mctt->updateFromAny(&any.in(), mresult);
} else {
CSendHandle_var sh = mfact->sendOperation( mop.c_str(), nargs.in() );
AssignableDataSource<CSendHandle_var>::shared_ptr ads = AssignableDataSource<CSendHandle_var>::narrow( mresult.get() );
if (ads) {
ads->set( sh ); // _var creates a copy of the obj reference.
}
}
return true;
} catch ( corba::CNoSuchNameException& ) {
return false;
} catch ( corba::CWrongNumbArgException& ) {
return false;
} catch ( corba::CWrongTypeArgException& ) {
return false;
}
}
示例2: get
SendStatus get() const {
try {
// only try to collect if we didn't do so before:
if ( mss != SendSuccess ) {
corba::CAnyArguments_var nargs;
if ( misblocking->get() ) {
mss = SendStatus( static_cast<int>(msh->collect( nargs.out() ) ) - 1 );
} else {
mss = SendStatus( static_cast<int>(msh->collectIfDone( nargs.out() ) ) - 1 );
}
// only convert results when we got a success:
if (mss == SendSuccess) {
assert( nargs->length() == margs.size() );
for (size_t i=0; i < margs.size(); ++i ) {
const types::TypeInfo* ti = margs[i]->getTypeInfo();
CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) );
assert( ctt );
ctt->updateFromAny( &nargs[i], margs[i] );
}
}
}
return mss;
} catch ( corba::CWrongNumbArgException& ) {
return mss;
} catch ( corba::CWrongTypeArgException& ) {
return mss;
}
}
示例3: string
::CORBA::Boolean RTT_corba_CConfigurationInterface_i::setAttribute (
const char * name,
const ::CORBA::Any & value)
{
if ( !mar || !mar->hasAttribute( string(name) ) )
return 0;
DataSourceBase::shared_ptr ds = mar->getValue( string(name) )->getDataSource();
const TypeInfo* ti = ds->getTypeInfo();
CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) );
assert( ctt );
return ctt->updateFromAny( &value, ds );
}
示例4: getPropertyDataSource
::CORBA::Boolean RTT_corba_CConfigurationInterface_i::setProperty (
const char * name,
const ::CORBA::Any & value)
{
if (mar)
mbag = mar->properties(); // leave this here to get latest propertybag.
DataSourceBase::shared_ptr ds = getPropertyDataSource(name);
if ( !ds )
return 0;
const TypeInfo* ti = ds->getTypeInfo();
CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) );
assert( ctt );
return ctt->updateFromAny( &value, ds );
}