本文整理汇总了C++中ExecutionEngine::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ ExecutionEngine::getParent方法的具体用法?C++ ExecutionEngine::getParent怎么用?C++ ExecutionEngine::getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExecutionEngine
的用法示例。
在下文中一共展示了ExecutionEngine::getParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: start
bool IRQActivity::start()
{
if (m_irq == -1)
{ // no FD explicitely set. Try to find one.
ExecutionEngine* engine = dynamic_cast<ExecutionEngine*>(m_runner);
if (engine)
{
Provider* provider = dynamic_cast<Provider*>(engine->getParent());
if (provider)
m_irq = provider->getIRQ();
}
}
if (m_irq == -1)
{
Logger::log() << Logger::Error << "no IRQ set for IRQActivity" << Logger::endl;
return false;
}
char name[20];
if (snprintf(name, 20, "IRQActivity%d", m_irq) >= 20)
{
Logger::log() << Logger::Error << "something is wrong with m_irq. Are you trying to do a buffer overflow ?" << strerror(errno) << Logger::endl;
return false;
}
int ret = rt_intr_create(&m_handle, name, m_irq, 0);
if (ret != 0)
{
Logger::log() << Logger::Error << "cannot create interrupt object for IRQ " << m_irq << ": " << strerror(-ret) << Logger::endl;
return false;
}
if (! Activity::start())
{
rt_intr_delete(&m_handle);
return false;
}
return true;
}