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


C++ Context::communicator方法代码示例

本文整理汇总了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();

}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:46,代码来源:multicamerareader.cpp

示例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() );
    }

}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:19,代码来源:multicamerawriter.cpp

示例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;
}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:22,代码来源:icegridutils.cpp


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