本文整理汇总了C++中DataWriter_var::get_publisher方法的典型用法代码示例。如果您正苦于以下问题:C++ DataWriter_var::get_publisher方法的具体用法?C++ DataWriter_var::get_publisher怎么用?C++ DataWriter_var::get_publisher使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataWriter_var
的用法示例。
在下文中一共展示了DataWriter_var::get_publisher方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: recreate_data_writer_and_topic
void recreate_data_writer_and_topic(DataWriter_var& dw, const DataReader_var& dr)
{
DataWriterQos dw_qos;
dw->get_qos(dw_qos);
Topic_var topic = dw->get_topic();
TopicQos topic_qos;
topic->get_qos(topic_qos);
CORBA::String_var topic_name = topic->get_name(),
type_name = topic->get_type_name();
Publisher_var pub = dw->get_publisher();
DomainParticipant_var dp = pub->get_participant();
pub->delete_datawriter(dw);
dw = 0;
dp->delete_topic(topic);
topic = 0;
// Wait until the data reader is not associated with the writer.
wait_match (dr, 0);
topic = dp->create_topic(topic_name, type_name, topic_qos, 0, 0);
if (!topic) {
ACE_DEBUG((LM_ERROR, "ERROR: %P failed to re-create topic\n"));
return;
}
dw = pub->create_datawriter(topic, dw_qos, 0, 0);
if (!dw) {
ACE_DEBUG((LM_ERROR, "ERROR: %P failed to re-create data writer\n"));
}
}