本文整理汇总了C++中dds::DataWriter_var::get_offered_deadline_missed_status方法的典型用法代码示例。如果您正苦于以下问题:C++ DataWriter_var::get_offered_deadline_missed_status方法的具体用法?C++ DataWriter_var::get_offered_deadline_missed_status怎么用?C++ DataWriter_var::get_offered_deadline_missed_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dds::DataWriter_var
的用法示例。
在下文中一共展示了DataWriter_var::get_offered_deadline_missed_status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ACE_TMAIN
//.........这里部分代码省略.........
cerr << "ERROR: set deadline qos failed." << endl;
exit(1);
}
{
// Two threads use same datawriter to write different instances.
std::auto_ptr<Writer> writer1 (new Writer (dw.in (), 99, SLEEP_DURATION));
std::auto_ptr<Writer> writer2 (new Writer (dw.in (), 100, SLEEP_DURATION));
writer1->start ();
writer2->start ();
// ----------------------------------------------
// Wait for fully associate with DataReaders.
if (writer1->wait_for_start () == false || writer2->wait_for_start () == false)
{
cerr << "ERROR: took too long to associate. " << endl;
exit (1);
}
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Publisher: sleep for %d milliseconds\n"),
SLEEP_DURATION.msec ()));
// Wait for a set of deadline periods to expire.
ACE_OS::sleep (SLEEP_DURATION);
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Publisher: now verify missed ")
ACE_TEXT ("deadline status \n")));
::DDS::InstanceHandle_t handle1 = writer1->get_instance_handle ();
::DDS::InstanceHandle_t handle2 = writer2->get_instance_handle ();
DDS::OfferedDeadlineMissedStatus deadline_status;
if (dw->get_offered_deadline_missed_status(deadline_status) != ::DDS::RETCODE_OK)
{
cerr << "ERROR: Failed to get offered deadline missed status" << endl;
exit (1);
}
ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Publisher: got missed")
ACE_TEXT ("deadline status \n")));
if (deadline_status.total_count != NUM_EXPIRATIONS * NUM_WRITE_THREADS)
{
cerr << "ERROR: Unexpected number of missed offered "
<< "deadlines (" << deadline_status.total_count
<< " instead of " << NUM_EXPIRATIONS * NUM_WRITE_THREADS << ") "
<< endl;
exit (1);
}
if (deadline_status.total_count_change != NUM_EXPIRATIONS * NUM_WRITE_THREADS)
{
cerr << "ERROR: Incorrect missed offered "
<< "deadline count change ("
<< deadline_status.total_count_change
<< ") instead of " << NUM_EXPIRATIONS * NUM_WRITE_THREADS
<< endl;
exit (1);
}
if (deadline_status.last_instance_handle != handle1
&& deadline_status.last_instance_handle != handle2)
{