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