Working with topics.
More...
Working with topics.
Registering a user data type
- Set up participant
- Register user data type of type
Foo
under the name "My Type" type_name = "My Type";
try {
Console.WriteLine("***Error: failed to register type");
}
Setting up a topic
- Set up participant
- Ensure user data type is registered
- 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);
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);
Console.WriteLine("***Error: failed to delete topic");
}