21 package org.opensplice.dds.topic;
23 import java.util.Collection;
49 DomainEntityImpl<DDS.Topic, DomainParticipantImpl, DDS.DomainParticipant, TopicQos, TopicListener<TYPE>, TopicListenerImpl<TYPE>>
57 Collection<Class<? extends Status>> statuses) {
58 super(environment, participant, participant.
getOld());
62 "Supplied DataReaderQos is null.");
64 if (typeSupport == null) {
66 "Supplied TypeSupport is null.");
68 this.typeSupport = typeSupport;
75 "Registration of Type with name '" 81 }
catch (ClassCastException e) {
83 "Cannot create Topic with non-OpenSplice qos");
86 if (listener != null) {
92 DDS.Topic old = this.
parent.getOld().create_topic(topicName,
101 if (this.listener != null) {
102 this.listener.setInitialised();
106 @SuppressWarnings(
"unchecked")
109 super(environment, participant, participant.getOld());
112 if (topicName == null) {
114 "Supplied Topic name is null.");
118 "Invalid <null> Topic provided.");
125 if (
"DCPSParticipant".equals(topicName)) {
128 DDS.ParticipantBuiltinTopicData.class, null);
129 }
else if (
"DCPSTopic".equals(topicName)) {
131 this.
environment, DDS.TopicBuiltinTopicData.class, null);
132 }
else if (
"CMSubscriber".equals(topicName)) {
135 DDS.CMSubscriberBuiltinTopicData.class, null);
136 }
else if (
"CMPublisher".equals(topicName)) {
139 DDS.CMPublisherBuiltinTopicData.class, null);
140 }
else if (
"CMParticipant".equals(topicName)) {
143 DDS.CMParticipantBuiltinTopicData.class, null);
144 }
else if (
"DCPSSubscription".equals(topicName)) {
147 DDS.SubscriptionBuiltinTopicData.class, null);
148 }
else if (
"CMDataReader".equals(topicName)) {
151 DDS.CMDataReaderBuiltinTopicData.class, null);
152 }
else if (
"DCPSPublication".equals(topicName)) {
155 DDS.PublicationBuiltinTopicData.class, null);
156 }
else if (
"CMDataWriter".equals(topicName)) {
159 DDS.CMDataWriterBuiltinTopicData.class, null);
160 }
else if (
"DCPSType".equals(topicName)) {
163 DDS.TypeBuiltinTopicData.class, null);
168 }
catch (ClassCastException cce) {
169 this.typeSupport = null;
177 if (listener != null) {
181 wrapperListener = null;
183 rc = this.
getOld().set_listener(wrapperListener, mask);
185 "Topic.setListener() failed.");
187 this.listener = wrapperListener;
197 Collection<Class<? extends Status>> statuses) {
198 this.setListener(listener,
204 Class<? extends Status>... statuses) {
205 this.setListener(listener,
211 DDS.TopicQosHolder holder =
new DDS.TopicQosHolder();
212 int rc = this.
getOld().get_qos(holder);
214 "Topic.getQos() failed.");
225 "Supplied TopicQos is null.");
229 }
catch (ClassCastException e) {
231 "Setting non-OpenSplice Qos not supported.");
235 "Topic.setQos() failed.");
241 DDS.InconsistentTopicStatusHolder holder =
new DDS.InconsistentTopicStatusHolder();
242 int rc = this.
getOld().get_inconsistent_topic_status(holder);
244 "Topic.getInconsistentTopicStatus()");
251 DDS.StatusCondition oldCondition = this.
getOld().get_statuscondition();
253 if (oldCondition == null) {
262 this.
parent.destroyTopic(
this);
268 if (this.typeSupport == null) {
270 "TypeSupport is unknown for this Topic. Has Topic been " 271 +
"obtained using DomainParticipant.findTopic() " 274 return this.typeSupport;
277 @SuppressWarnings(
"unchecked")
284 }
catch (ClassCastException cce) {
286 "Unable to perform requested cast.");
297 if (this.typeSupport != null) {
298 return this.typeSupport.getTypeName();
305 return this.
getOld().get_name();
315 int rc = this.
getOld().dispose_all_data();
317 "Topic.disposeAllData() failed.");
322 DDS.AllDataDisposedTopicStatusHolder holder =
new DDS.AllDataDisposedTopicStatusHolder();
323 int rc = this.
getOld().get_all_data_disposed_topic_status(holder);
325 "Topic.getAllDataDisposedTopicStatus()");
String getName()
Returns the name used to create the TopicDescription.
The DomainParticipant object plays several roles:
A StatusCondition object is an immutable object that specifies Condition that is associated with each...
InconsistentTopicStatus getInconsistentTopicStatus()
This method allows the application to retrieve the org.omg.dds.core.status.InconsistentTopicStatus of...
TypeSupport< TYPE > getTypeSupport()
Returns the org.omg.dds.type.TypeSupport used to create this TopicDescription.
StatusCondition< Topic< TYPE > > getStatusCondition()
static TopicQosImpl convert(OsplServiceEnvironment env, DDS.TopicQos oldQos)
static QosPolicyCount [] convert(OsplServiceEnvironment env, DDS.QosPolicyCount[] old)
void setQos(TopicQos qos)
TopicImpl(OsplServiceEnvironment environment, DomainParticipantImpl participant, String topicName, AbstractTypeSupport< TYPE > typeSupport, TopicQos qos, TopicListener< TYPE > listener, Collection< Class<? extends Status >> statuses)
void setListener(TopicListener< TYPE > listener, Class<? extends Status >... statuses)
AllDataDisposedStatus getAllDataDisposedTopicStatus()
String getTypeName()
Returns the type name used to create the TopicDescription.
static Set< Class<? extends Status > > convertMask(OsplServiceEnvironment environment, int state)
abstract String getTypeName()
static void checkReturnCode(int retCode, OsplServiceEnvironment environment, String message)
Since org.omg.dds.topic.Topic is a kind of org.omg.dds.core.Entity, it has the ability to have an ass...
All instances for one or more org.omg.dds.topic.Topics have been disposed through org...
TypeSupport is an abstract interface that has to be specialized for each concrete type that will be u...
final transient OsplServiceEnvironment environment
void setListener(TopicListener< TYPE > listener)
static void throwLastErrorException(OsplServiceEnvironment environment)
DomainParticipant getParent()
This interface is the base for org.omg.dds.topic.Topic, org.omg.dds.topic.ContentFilteredTopic, and org.omg.dds.topic.MultiTopic.
Topic is the most basic description of the data to be published and subscribed.
Another topic exists with the same name but different characteristics.
abstract DDS.TypeSupport getOldTypeSupport()
void setListener(TopicListener< TYPE > listener, Collection< Class<? extends Status >> statuses)
Status is the abstract root class for all communication status objects.