本文整理汇总了C++中orcaice::Context::communicator方法的典型用法代码示例。如果您正苦于以下问题:C++ Context::communicator方法的具体用法?C++ Context::communicator怎么用?C++ Context::communicator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类orcaice::Context
的用法示例。
在下文中一共展示了Context::communicator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: helper
void
MultiCameraReader::readFromFile( std::ifstream *file,
const std::string &format,
orcaice::Context context,
orca::MultiCameraDescriptionPtr &obj )
{
descr_ = new orca::MultiCameraDescription();
if ( format=="ice" )
{
orcalog::IceReadHelper helper( context.communicator(), file );
ice_readMultiCameraDescription( helper.stream_, obj );
helper.read();
}
else if ( format=="jpeg" || format=="bmp" || format=="avi")
{
#ifndef OPENCV_FOUND
std::stringstream infostring;
infostring << "Images can only be replayed in '" << format << "' format if you have OpenCV.";
context.tracer().info( infostring.str() );
context.tracer().info( "Please have a look at the documentation for installing OpenCV." );
std::stringstream errorstring;
errorstring << "Logger: '"<< format <<"' format not supported because OpenCV is not installed.";
throw orcalog::FormatNotSupportedException( ERROR_INFO, errorstring.str() );
#endif
// Populate the description with data from the file
std::string line;
std::getline( *file, line );
std::stringstream ss( line );
fromLogString( ss, descr_ );
// Point the descriptor pointer to our copy of it
obj = descr_;
}
else
{
stringstream ss;
ss << "can't handle format: " << format;
throw orcalog::FormatNotSupportedException( ERROR_INFO, ss.str() );
}
// Now that we know the size, initialise the data storage
initDataStorage();
}
示例2: helper
void
MultiCameraWriter::logToFile( std::ofstream *file, const std::string &format, orcaice::Context context, const orca::MultiCameraDescriptionPtr &obj)
{
if ( format=="ice" ){
orcalog::IceWriteHelper helper( context.communicator() );
ice_writeMultiCameraDescription( helper.stream_, obj );
helper.write( file );
}
else if ( format=="jpeg" || format == "bmp" || format=="avi") {
//Log the MultiCamera Description to an ascii file
(*file) << toLogString(obj) << endl;
}
else{
stringstream ss;
ss << "can't handle format: " << format;
throw orcalog::FormatNotSupportedException( ERROR_INFO, ss.str() );
}
}
示例3: assert
Ice::ObjectPrx
getComponentAdmin( const orcaice::Context& context, const orca::FQComponentName& fqName )
{
orca::FQComponentName resolvedFqname = orcaice::resolveLocalPlatform( context, fqName );
Ice::CommunicatorPtr ic = context.communicator();
assert( ic );
Ice::LocatorPrx locatorPrx = ic->getDefaultLocator();
Ice::Identity adminId = toAdminIdentity( resolvedFqname );
Ice::ObjectPrx adminPrx;
try {
adminPrx = locatorPrx->findObjectById( adminId );
}
catch ( const Ice::Exception& ) {
// what do we do?
}
return adminPrx;
}