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


C++ IProperty::getProperties方法代码示例

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


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

示例1: genConfig


//.........这里部分代码省略.........
      //}

      if ( !known ) {
        cout << "WARNING: Unknown (return) type [" << rtype << "] !!\n"
             << "WARNING: component [" << ident << "] is skipped !"
             << endl;
        allGood = false;
        continue;
      }

      string cname = "DefaultName";
      vector<void*>  args;
      args.reserve( 3 );
      if ( type == "AlgTool" ) {
        args.resize( 3 );
        args[0] = &cname;
        args[1] = &type;
        args[2] = dummySvc;
      }
      else {
        args.resize( 2 );
        args[0] = &cname;
        args[1] = svcLoc;
      }
      IProperty* prop = 0;
      try {
        if ( type == "Algorithm" ) {
          prop = makeInstance<IAlgorithm>(*it,args);
        }
        else if ( type == "Service") {
          prop = makeInstance<IService>(*it,args);
        }
        else if ( type == "AlgTool") {
          prop = makeInstance<IAlgTool>(*it,args);
        }
        else if ( type == "Auditor") {
          prop = makeInstance<IAuditor>(*it,args);
        }
        else if ( type == "ApplicationMgr") {
          //svcLoc->queryInterface(IProperty::interfaceID(), pp_cast<void>(&prop));
          svcLoc->queryInterface(IProperty::interfaceID(), (void**)(&prop));
        }
        else {
          prop = makeInstance<IInterface>(*it,args);
        }
      }
      catch ( exception& e ) {
        cout << "ERROR: Error instantiating " << name
             << " from " << *iLib << endl;
        cout << "ERROR: Got exception: " << e.what() << endl;
        allGood = false;
        continue;
      }
      catch ( ... ) {
        cout << "ERROR: Error instantiating " << name
             << " from " << *iLib << endl;
        allGood = false;
        continue;
      }
      if( prop ) {
        if (genComponent( *iLib, name, type, prop->getProperties() )) {
          allGood = false;
        }
        prop->release();
      } else {
        cout << "ERROR: could not cast IInterface* object to an IProperty* !\n"
             << "ERROR: return type from PluginSvc is [" << rtype << "]...\n"
             << "ERROR: NO Configurable will be generated for ["
             << name << "] !"
             << endl;
        allGood = false;
      }
    } //> end loop over factories

    ///
    /// write-out files for this library
    ///
    const std::string pyName = ( fs::path(m_outputDirName) /
                  fs::path(*iLib+"Conf.py") ).string();
    const std::string dbName = ( fs::path(m_outputDirName) /
                  fs::path(*iLib+"_confDb.py") ).string();

    std::fstream py( pyName.c_str(),
              std::ios_base::out|std::ios_base::trunc );
    std::fstream db( dbName.c_str(),
              std::ios_base::out|std::ios_base::trunc );

    genHeader ( py, db );
    if (!userModule.empty()) 
      py << "from " << userModule << " import *" <<endl;
    genBody   ( py, db );
    genTrailer( py, db );

  } //> end loop over libraries

  dummySvc->release();
  dummySvc = 0;

  return allGood ? EXIT_SUCCESS : EXIT_FAILURE;
}
开发者ID:atlas-org,项目名称:gaudi,代码行数:101,代码来源:genconf.cpp


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