本文整理汇总了C++中Executor::execute方法的典型用法代码示例。如果您正苦于以下问题:C++ Executor::execute方法的具体用法?C++ Executor::execute怎么用?C++ Executor::execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executor
的用法示例。
在下文中一共展示了Executor::execute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: shooSH_run
/*!
* \brief Funcao que executa a Shell.
*/
void shooSH_run (void) {
Job* job;
Parser p;
Executor executor;
bool exited = false;
while (!exited) {
std::cout << "shooSH> ";
job = p.parseLine ();
history.push_back (job->getCommand());
if (job->hasFailed ()) {
std::cout << "Erro de sintaxe" << std::endl;
} else {
if (!(job->isNop()||job->hasExited())) {
if (!job->hasPipe()) {
if (executeBuiltin (job->getProcess(0)) == -1) {
job->setID (++currID);
jobList.push_back (job);
executor.execute (job);
}
} else {
job->setID (++currID);
jobList.push_back (job);
executor.execute (job);
}
} else {
exited = job->hasExited();
}
}
job = NULL;
}
shooSH_clean();
}
示例2: multi_agent_execute_with_shared_inits_returning_void
__AGENCY_ANNOTATION
void multi_agent_execute_with_shared_inits_returning_void(use_multi_agent_execute_with_shared_inits_returning_void_member_function,
Executor& ex, Function f, typename executor_traits<Executor>::shape_type shape,
Factories... shared_factories)
{
return ex.execute(f, shape, shared_factories...);
} // end multi_agent_execute_with_shared_inits_returning_void()
示例3: main
int main(void)
{
try
{
log_open("run.log");
FM_LOG_DEBUG("opened");
com.init();
cout << "after init!!" << endl;
com.compile();
cout << com.getResult() << endl;
if(string("Compile Error") == com.getResult())
{
return 0;
}
cout << "after compile" << endl;
Exec.execute();
cout << "after execute" << endl;
int result = checker.checkDiff();
if(result == 0)
{
cout << "AC" << endl;
}
else if(result == 1)
{
cout << "PE" << endl;
}
else if(result == 2)
{
cout << "WA" << endl;
}
}
// catch(exception &ex)
// {
// cout << ex.what() << endl;
// }
catch(JudgeException &ex)
{
cout << ex.what() << endl;
}
return 0;
}
示例4: _init
void CG_GGVar::_init()
{
CG_GGVar& gi(*this);
gi.reserve(4*1024);
gi.add(new CallableWrapT<String>("1.0 beta"), "sys.VERSION");
gi.add_inner<CallableFunctionCaptureLocal>();
gi.add_inner<CallableFunctionSame>();
gi.add_inner<CallableTableProxyGlobal>();
gi.add_inner<CallableCommandNoop>();
gi.add_inner<CallableFunctionImport>();
gi.add_inner<CallableFunctionClone>();
gi.add_inner<CallableFunctionTypeId>();
gi.add_inner<CallableFunctionIsNil>();
gi.add_inner<CallableFunctionIsTable>();
gi.add_inner<CallableFunctionIsString>();
gi.add_inner<CallableFunctionIsArray>();
gi.add_inner<CallableFunctionIsNumber>();
gi.add_inner<CallableFunctionIsBoolean>();
gi.add_inner<CallableCommandClear>();
gi.add_inner<CallableCommandClc>();
gi.add_inner<CallableCommandExec>();
gi.add_inner<CallableCommandEval>();
gi.add_inner<CallableCommandLoadEwsl>();
gi.add_inner<CallableFunctionAssert>();
gi.add_inner<CallableFunctionHelp>();
gi.add_inner<CallableFunctionTranslate>();
gi.add_inner<CallableFunctionTranslateKT>();
gi.add_inner<CallableFunctionTranslateHT>();
gi.add_inner<CallableFunctionTranslateZT>();
init_module_number();
init_module_string();
init_module_table();
init_module_array();
init_module_io();
init_module_os();
init_module_math();
init_module_logger();
init_module_coroutine();
init_module_regex();
gi.add(NULL,"pcall");
gi.add(NULL,"map");
gi.add(NULL,"map_k");
gi.add(NULL,"reduce");
gi.add(NULL,"reduce_k");
gi.add(NULL,"select");
gi.add(NULL,"join");
gi.add(NULL,"array_concat");
gi.add(NULL, "#internal_end");
_bInited=true;
for (size_t i = 0; i < gi.size(); i++)
{
if (gi.get(i).first == "#internal_end") break;
gi.sm_vmap[gi.get(i).first] = new CG_Variable(VAR_SYSTEM, gi.get(i).first);
}
size_t n = gi.size();
for (size_t i = 0; i < n; i++)
{
CallableTableEx* p = dynamic_cast<CallableTableEx*>(gi.get(i).second.kptr());
if (!p) continue;
String lib = gi.get(i).first;
for (VariantTable::const_iterator it=p->value.begin();it!=p->value.end();++it)
{
gi[lib + "." + (*it).first] = (*it).second;
}
}
Executor ewsl;
ewsl.execute(
"\n"
"function pcall(fn,...)\n"
"{\n"
" try \n"
" return true,fn(...);\n"
" catch(...) \n"
" return false,...;\n"
"};\n"
"\n"
"function map(x,f)\n"
"{\n"
" local r=[];\n"
" for_each(v in x)\n"
" {\n"
" r.push(f(v));\n"
" }\n"
" return r;\n"
"};\n"
//.........这里部分代码省略.........