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


C++ shared_ptr::updateCommand方法代码示例

本文整理汇总了C++中datasourcebase::shared_ptr::updateCommand方法的典型用法代码示例。如果您正苦于以下问题:C++ shared_ptr::updateCommand方法的具体用法?C++ shared_ptr::updateCommand怎么用?C++ shared_ptr::updateCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在datasourcebase::shared_ptr的用法示例。


在下文中一共展示了shared_ptr::updateCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addDisplaySource

    bool ImageDisplayComponent::addDisplaySource(std::string tag, std::string type, DataSourceBase::shared_ptr orig)
    {

        // creates a copy of the data and an update command to
        // update the copy from the original.
        //
        // Added IplImage type
        Logger::In in("ImageDisplayComponent");

        // Check if the type is IplImage, if this fail
        if(orig->getTypeName()!="IplImage"){
            log(Error) << "Could not display '"<< tag <<"': This is not a IplImage type, it the Vision tookkit loaded?" << endlog();
            return false;
        }
        DataSourceBase::shared_ptr clone = orig->getTypeInfo()->buildValue();
        if ( !clone ) {
            log(Error) << "Could not display '"<< tag <<"' : unknown type." << endlog();
            return false;
        }
        try {
            boost::shared_ptr<CommandInterface> comm( clone->updateCommand( orig.get() ) );
            assert( comm );
            root.push_back( boost::make_tuple( tag, orig, comm, clone, type ) );
        } catch ( bad_assignment& ba ) {
            log(Error) << "Could not display '"<< tag <<"' : failed to create Command." << endlog();
            return false;
        }
        return true;
    }
开发者ID:ptroja,项目名称:orocos-ocl,代码行数:29,代码来源:DisplayImageComponent.cpp


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