Working with topics.
More...
Working with topics.
Registering a user data type
- Register user data type of type
Foo
under the name "My Type" type_name = "My Type";
try {
} catch (DDS.Exception) {
Console.WriteLine("***Error: failed to register type");
}
Setting up a topic
- Create a Topic under the name "My Topic"
TopicQos topic_qos = new TopicQos();
TopicListener topic_listener = null;
try {
participant.get_default_topic_qos(topic_qos);
} catch (DDS.Exception) {
Console.WriteLine(
"***Error: failed to get default topic qos");
}
topic_name = "My Topic";
Topic topic = participant.create_topic(
topic_name,
type_name,
topic_qos,
topic_listener,
if (topic == null) {
Console.WriteLine("***Error: failed to create topic");
}
Tearing down a topic
- Delete Topic:
try {
participant.delete_topic(ref topic);
} catch (DDS.Exception) {
Console.WriteLine("***Error: failed to delete topic");
}