本文整理汇总了C++中Application::Execute方法的典型用法代码示例。如果您正苦于以下问题:C++ Application::Execute方法的具体用法?C++ Application::Execute怎么用?C++ Application::Execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Application
的用法示例。
在下文中一共展示了Application::Execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitHandler
bool PowerHandler::InitHandler(const char* prj_name, const char* case_name, double sim_time, double sim_period)
{
_instance = _api_fixture->GetInstance(); //ApiFixture is responsible for creation/destruction api instance
if (!_instance) {
//std::cout << "InitHandler, error:ApiFixture::GetInstance()" << std::endl;
return false;
}
int ret = 0;
Application* app = _instance->GetApplication();
DataObject* user = app->GetCurrentUser();
DataObject* prj = GetProject(user, prj_name);
DataObject* e_case = GetCaseObject(prj, case_name);
Value v_prj(prj);
Value v_case(e_case);
if (prj != app->GetActiveProject()){
app->Execute("Activate", &v_prj, &ret); //激活项目
if (ret > 0){
//std::cout << "InitHandler, error: Execute v_prj" << std::endl;
return false;
}
}
if (e_case != app->GetActiveStudyCase()){
app->Execute("Activate", &v_case, &ret);//激活项目
if (ret > 0){
// std::cout << "InitHandler, error: Execute v_case" << std::endl;
return false;
}
}
//delete the last EvtParam for no influencing the next simulation
Value v_ev("IntEvt");
ValueGuard int_ev(app->Execute("GetCaseObject", &v_ev));
DataObject* events = int_ev->GetDataObject();
DataObjVec folders = Utils::GetChildren(events, "EvtParam");
DataObjVec::iterator it = folders.begin();
for (; it != folders.end(); ++it) {
DataObject* folder = *it;
folder->DeleteObject();
}
_sim_time = sim_time;
_sim_period = sim_period;
//std::cout << "InitHandler, success." << std::endl;
return true;
}
示例2: main
int main(int argc, char* argv[])
{
Application* app = new Application(ApplicationConfig(800, 600, "Test Harness"));
try
{
app->AttachService<ScriptingService>();
app->AttachService<FramesService>();
app->Startup();
ScriptingService* scripting = dynamic_cast<ScriptingService*>(app->GetService("SCRIPTING"));
scripting->RunFile("./boot.lua");
app->Execute();
app->Shutdown();
}
catch (exception ex)
{
cerr << "Exception occurred: " << ex.what() << endl;
}
delete app;
return 0;
}
示例3: main
int main( int p_Argc, char **p_ppArgv )
{
Application Client;
if( Client.Initialise( ) == 0 )
{
std::cout << "Failed to initialise the client" << std::endl;
return 0;
}
return Client.Execute( );
}
示例4: main
int main(int argc,char* argv[])
{
if(Utils::Init())
{
Application instance;
instance.Execute();
}
Utils::Free();
return 0;
}
示例5: main
int main()
{
Application app;
return app.Execute();
}