本文整理汇总了C++中Functions::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ Functions::push_back方法的具体用法?C++ Functions::push_back怎么用?C++ Functions::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions::push_back方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFuncs
void PatchMgr::getFuncs(Scope &scope, Functions &funcs) {
if (scope.wholeProgram) {
AddrSpace::ObjMap &objs = as()->objMap();
for (AddrSpace::ObjMap::iterator iter = objs.begin(); iter != objs.end(); ++iter) {
iter->second->funcs(std::back_inserter(funcs));
}
}
else if (scope.obj) {
scope.obj->funcs(std::back_inserter(funcs));
}
else if (scope.func) {
funcs.push_back(scope.func);
}
}
示例2: loadFunctions
ScriptingService::Functions ScriptingService::loadFunctions( const string& code, const string& filename, bool mrethrow )
{
Logger::In in("ScriptingService::loadFunctions");
Parser p;
Functions exec;
Functions ret;
try {
Logger::log() << Logger::Info << "Parsing file "<<filename << Logger::endl;
ret = p.parseFunction(code, mowner, filename);
}
catch( const file_parse_exception& exc )
{
#ifndef ORO_EMBEDDED
Logger::log() << Logger::Error << filename<<" :"<< exc.what() << Logger::endl;
if ( mrethrow )
throw;
#endif
return Functions();
}
if ( ret.empty() )
{
Logger::log() << Logger::Debug << "No Functions executed from "<< filename << Logger::endl;
Logger::log() << Logger::Info << filename <<" : Successfully parsed." << Logger::endl;
return Functions();
} else {
// Load all listed functions in the TaskContext's Processor:
for( Parser::ParsedFunctions::iterator it = ret.begin(); it != ret.end(); ++it) {
Logger::log() << "Queueing Function "<< (*it)->getName() << Logger::endl;
if ( mowner->engine()->runFunction( it->get() ) == false) {
Logger::log() << Logger::Error << "Could not run Function '"<< (*it)->getName() <<"' :" << Logger::nl;
Logger::log() << "Processor not accepting or function queue is full." << Logger::endl;
} else
exec.push_back( *it ); // is being executed.
}
}
return exec;
}