本文整理汇总了C++中DomainParticipant_var::set_qos方法的典型用法代码示例。如果您正苦于以下问题:C++ DomainParticipant_var::set_qos方法的具体用法?C++ DomainParticipant_var::set_qos怎么用?C++ DomainParticipant_var::set_qos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomainParticipant_var
的用法示例。
在下文中一共展示了DomainParticipant_var::set_qos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run_test
//.........这里部分代码省略.........
waiter->detach_condition(rc);
if (result != RETCODE_OK) {
ACE_DEBUG((LM_ERROR,
"ERROR: %P TestMsg reader could not wait for condition: %d\n", result));
return false;
}
TestMsgDataReader_var tmdr = TestMsgDataReader::_narrow(dr);
TestMsgSeq data;
SampleInfoSeq infos;
ReturnCode_t ret = tmdr->read_w_condition(data, infos, LENGTH_UNLIMITED, rc);
if (ret != RETCODE_OK) {
ACE_DEBUG((LM_ERROR, "ERROR: %P could not read TestMsg: %d\n", ret));
return false;
}
bool ok = false;
for (CORBA::ULong i = 0; i < data.length(); ++i) {
if (infos[i].valid_data) {
ok = true;
ACE_DEBUG((LM_DEBUG, "%P Read data sample: %d\n", data[i].value));
}
}
if (!ok) {
ACE_DEBUG((LM_ERROR, "ERROR: %P no valid data from TestMsg data reader\n"));
}
// Change dp qos
{
DomainParticipantQos dp_qos;
dp_pub->get_qos(dp_qos);
set_qos(dp_qos.user_data.value, TestConfig::PARTICIPANT_USER_DATA2());
dp_pub->set_qos(dp_qos);
}
// Change dw qos
{
DataWriterQos dw_qos;
dw->get_qos(dw_qos);
set_qos(dw_qos.user_data.value, TestConfig::DATA_WRITER_USER_DATA2());
dw->set_qos(dw_qos);
}
// Change dr qos
{
DataReaderQos dr_qos;
dr->get_qos(dr_qos);
set_qos(dr_qos.user_data.value, TestConfig::DATA_READER_USER_DATA2());
dr->set_qos(dr_qos);
}
// Wait for propagation
ACE_OS::sleep(3);
if (!read_participant_bit(bit_sub, dp_sub, pub_repo_id, TestConfig::PARTICIPANT_USER_DATA2())) {
return false;
}
if (!read_publication_bit(bit_sub, dp_sub, pub_repo_id, ig_ih, TestConfig::DATA_WRITER_USER_DATA2(), TestConfig::TOPIC_DATA(), 1, 1)) {
return false;
}
if (!read_subscription_bit(dp_pub->get_builtin_subscriber(), dp_pub, sub_repo_id, ig_ih, TestConfig::DATA_READER_USER_DATA2(), TestConfig::TOPIC_DATA())) {
return false;
}
// Set dw topic qos
Topic_var topic = dw->get_topic();
TopicQos topic_qos;
topic->get_qos(topic_qos);