本文整理汇总了C++中Executable::getHost方法的典型用法代码示例。如果您正苦于以下问题:C++ Executable::getHost方法的具体用法?C++ Executable::getHost怎么用?C++ Executable::getHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Executable
的用法示例。
在下文中一共展示了Executable::getHost方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onExecutableFailed
void YConsoleManager::onExecutableFailed(void* which)
{
Executable* exe = (Executable*) which;
if(config.find("module_failure").asString() == "prompt")
cout<<exe->getCommand()<<" from "<<exe->getHost()<<" is failed!"<<endl;
if(config.find("module_failure").asString() == "recover")
{
cout<<endl<<exe->getCommand()<<" from "<<exe->getHost()<<" is failed! (restarting...)"<<endl;
exe->start();
}
if(config.find("module_failure").asString() == "terminate")
{
cout<<endl<<exe->getCommand()<<" from "<<exe->getHost()<<" is failed! (terminating application...)"<<endl;
bShouldRun = false;
stop();
reportErrors();
}
}
示例2: onExecutableFailed
void SafeManager::onExecutableFailed(void* which)
{
WAIT_SEMAPHOR();
ErrorLogger* logger = ErrorLogger::Instance();
Executable* exe = static_cast<Executable*>(which);
if(exe)
{
if(m_pConfig->find("module_failure").asString() == "prompt")
{
OSTRINGSTREAM err;
err<<exe->getCommand()<<" from "<<exe->getHost()<<" is failed! [id:"<<exe->getID()<<"]";
logger->addError(err);
if(eventReceiver && exe)
eventReceiver->onModStop(exe->getID());
}
if(m_pConfig->find("module_failure").asString() == "recover")
{
OSTRINGSTREAM err;
err<<exe->getCommand()<<" from "<<exe->getHost()<<" is failed! [id:"<<exe->getID()<<"] (restarting...)";
logger->addError(err);
exe->start();
}
if(m_pConfig->find("module_failure").asString() == "terminate")
{
OSTRINGSTREAM err;
err<<exe->getCommand()<<" from "<<exe->getHost()<<" is failed! [id:"<<exe->getID()<<"] (terminating...)";
logger->addError(err);
Manager::stop();
}
}
if(eventReceiver)
eventReceiver->onError();
POST_SEMAPHOR();
}