4.1.4. Topic

Topic is a command that retrieves information of the Topics with at least one endpoint currently active in the network.

4.1.4.1. Key-words

These are the key-words recognize as this command: topic topics t T.

4.1.4.2. Arguments

Topic command support 0 or 1 argument:

4.1.4.2.1. No argument

When no arguments are given to this command, the information shown is a list with every topic with at least one endpoint currently active in the network. The information shown is the topic name, data type name, number of writers and readers and the subscription rate measured in samples per second. The output format is as follows: Simple Writer info.

4.1.4.2.2. Verbose

This argument queries for more complete information about each of the topics in the network. It adds the Guid of each endpoint on the topic and the whether the type has been discovered. The output is a list of data with verbose information. Check the verbose section in order to know which key-words are available for this argument.

4.1.4.2.3. Topic name

This argument requires a string with the topic name. This command queries the database for a single Topic and retrieves its verbose information. This Guid must exist inside the DDS network.

Note

If there are 2 topics with the same name and different Topic Data Type, only one of them could be visible. These is a circumstance that DDS allows, but it is strongly suggested not to do.

4.1.4.3. Output Format

The topic information is retrieved in 2 formats depending on the verbose option.

4.1.4.3.1. Simple Writer info

name: <topic name>
type: <data type name>
datawriters: <number of datawriters currently active>
datareaders: <number of datareaders currently active>
rate: <samples per second> Hz

4.1.4.3.2. Verbose Writer info

name: <topic name>
type: <data type name>
datawriters:
    - <Guid>
    - ...
datareaders:
    - <Guid>
    - ...
rate: <samples per second> Hz
dynamic_type_discovered: <bool>

4.1.4.4. Example

Let’s assume we have a DDS network where 2 ShapesDemo applications are running.

This would be the expected output for the command topics:

- name: Circle
  type: ShapeType
  datawriters: 2
  datareaders: 2
  rate: 13.0298 Hz
- name: Square
  type: ShapeType
  datawriters: 3
  datareaders: 2
  rate: 26.6975 Hz

This would be the expected output for the command topics verbose:

- name: Circle
  type: ShapeType
  datawriters:
    - 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.3.2
  datareaders:
    - 01.0f.44.59.c9.65.78.e5.00.00.00.00|0.0.2.7
  rate: 13.0286 Hz
  dynamic_type_discovered: true
- name: Square
  type: ShapeType
  datawriters:
    - 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.1.2
    - 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.2.2
  datareaders:
    - 01.0f.44.59.21.58.14.d2.00.00.00.00|0.0.2.7
    - 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.4.7
  rate: 26.685 Hz
  dynamic_type_discovered: true

This would be the expected output for the command topics Square:

name: Circle
type: ShapeType
datawriters:
  - 01.0f.44.59.da.57.de.ec.00.00.00.00|0.0.6.2
datareaders:
  - 01.0f.44.59.c9.65.78.e5.00.00.00.00|0.0.2.7
rate: 13.0418 Hz
dynamic_type_discovered: true