The role of enable() and disable() functions in CycloneDDS source code and how to add Qos to HelloWorld (create Qos first and then pass parameters into it)

early morning~

1 Introduction to enable() and disable() functions

In the C++ version of CycloneDDS, enable()and disable()functions are used to enable and disable entities (Entity).

Entity can be DomainParticipant、Publisher、Subscriber、Topic、DataWriteror DataReader.

These methods work as follows:

enable(): This method is used to enable the entity. Once enabled, the entity will start to perform its corresponding function, such as posting data, receiving data, etc.

disable(): This method is used to disable the entity. When disabled, the entity ceases to perform its function and will no longer perform any operations related to it.

For different types of entities, they may have different initial states when they are created .

In general, entities are enabled by default , but this may vary depending on the specific application and usage.

Guess you like

Origin blog.csdn.net/qq_42595610/article/details/132182783