本文整理汇总了C++中dds::StatusCondition_var::in方法的典型用法代码示例。如果您正苦于以下问题:C++ StatusCondition_var::in方法的具体用法?C++ StatusCondition_var::in怎么用?C++ StatusCondition_var::in使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dds::StatusCondition_var
的用法示例。
在下文中一共展示了StatusCondition_var::in方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BadParticipantException
Publisher::Publisher( const Options& options)
: status_( 0),
options_( options),
participant_(0),
publisher_(0),
waiter_( new DDS::WaitSet)
{
DDS::DomainParticipantFactory_var dpf = TheParticipantFactory;
// Create the DomainParticipant
this->participant_
= dpf->create_participant(
this->options_.domain(),
PARTICIPANT_QOS_DEFAULT,
DDS::DomainParticipantListener::_nil(),
::OpenDDS::DCPS::DEFAULT_STATUS_MASK
);
if( CORBA::is_nil( this->participant_.in())) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("failed to create a participant.\n")
));
throw BadParticipantException();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created participant in domain %d.\n"),
this->options_.domain()
));
}
// Create and register the type support.
DataTypeSupportImpl* testData = new DataTypeSupportImpl();
CORBA::String_var type_name = testData->get_type_name();
if( ::DDS::RETCODE_OK
!= testData->register_type( this->participant_.in(), 0)) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("unable to install type %C support.\n"),
type_name.in()
));
throw BadTypeSupportException ();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created type %C support.\n"),
type_name.in()
));
}
// Create the topic.
DDS::Topic_var topic = this->participant_->create_topic(
this->options_.topicName().c_str(),
type_name,
TOPIC_QOS_DEFAULT,
::DDS::TopicListener::_nil(),
::OpenDDS::DCPS::DEFAULT_STATUS_MASK
);
if( CORBA::is_nil( topic.in())) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("failed to create topic %C.\n"),
this->options_.topicName().c_str()
));
throw BadTopicException();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created topic %C.\n"),
this->options_.topicName().c_str()
));
}
// Create the publisher.
this->publisher_ = this->participant_->create_publisher(
PUBLISHER_QOS_DEFAULT,
::DDS::PublisherListener::_nil(),
::OpenDDS::DCPS::DEFAULT_STATUS_MASK
);
if( CORBA::is_nil(this->publisher_.in())) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("failed to create publisher.\n")
));
throw BadPublisherException();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created publisher.\n")
));
}
// Writer Qos policy values.
::DDS::DataWriterQos writerQos;
this->publisher_->get_default_datawriter_qos( writerQos);
writerQos.durability.kind = ::DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
//.........这里部分代码省略.........
示例2: BadParticipantException
Publisher::Publisher( const Options& options)
: options_( options),
waiter_( new DDS::WaitSet)
{
DDS::DomainParticipantFactory_var dpf = TheParticipantFactory;
// Create the DomainParticipant
this->participant_
= dpf->create_participant(
this->options_.domain(),
PARTICIPANT_QOS_DEFAULT,
DDS::DomainParticipantListener::_nil(),
::OpenDDS::DCPS::DEFAULT_STATUS_MASK
);
if( CORBA::is_nil( this->participant_.in())) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("failed to create a participant.\n")
));
throw BadParticipantException();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created participant in domain %d.\n"),
this->options_.domain()
));
}
// Create the transport.
OpenDDS::DCPS::TransportConfig_rch transport =
TheTransportRegistry->get_config(this->options_.transportKey());
if (transport.is_nil()) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Subscriber::Subscriber() - ")
ACE_TEXT("failed to get %C transport.\n"),
this->options_.transportKey().c_str()
));
throw BadTransportException();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Subscriber::Subscriber() - ")
ACE_TEXT("created %C transport.\n"),
this->options_.transportKey().c_str()
));
}
// Create and register the type support.
DataTypeSupportImpl* testData = new DataTypeSupportImpl();
if( ::DDS::RETCODE_OK
!= testData->register_type( this->participant_.in(), 0)) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("unable to install type %C support.\n"),
testData->get_type_name()
));
throw BadTypeSupportException ();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created type %C support.\n"),
testData->get_type_name()
));
}
// Create the topic.
this->topic_ = this->participant_->create_topic(
this->options_.topicName().c_str(),
testData->get_type_name(),
TOPIC_QOS_DEFAULT,
::DDS::TopicListener::_nil(),
::OpenDDS::DCPS::DEFAULT_STATUS_MASK
);
if( CORBA::is_nil( this->topic_.in())) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
ACE_TEXT("failed to create topic %C.\n"),
this->options_.topicName().c_str()
));
throw BadTopicException();
} else if( this->options_.verbose()) {
ACE_DEBUG((LM_DEBUG,
ACE_TEXT("(%P|%t) Publisher::Publisher() - ")
ACE_TEXT("created topic %C.\n"),
this->options_.topicName().c_str()
));
}
// Create the publisher.
this->publisher_ = this->participant_->create_publisher(
PUBLISHER_QOS_DEFAULT,
::DDS::PublisherListener::_nil(),
::OpenDDS::DCPS::DEFAULT_STATUS_MASK
);
if( CORBA::is_nil( this->publisher_.in())) {
ACE_ERROR((LM_ERROR,
ACE_TEXT("(%P|%t) ERROR: Publisher::Publisher() - ")
//.........这里部分代码省略.........