RTI Connext Modern C++ API Version 7.2.0
dds::core::policy::EntityFactory Class Reference

Configures a dds::core::Entity that acts as factory of other entities. More...

#include <dds/core/policy/CorePolicy.hpp>

Public Member Functions

 TEntityFactory ()
 Default policy. More...
 
 TEntityFactory (bool the_auto_enable)
 Specifies whether the entity acting as a factory automatically enables the instances it creates. More...
 
TEntityFactoryautoenable_created_entities (bool on)
 Specifies whether the entity acting as a factory automatically enables the instances it creates. More...
 
bool autoenable_created_entities () const
 Getter (see setter with the same name) More...
 

Static Public Member Functions

static TEntityFactory AutoEnable ()
 Creates EntityFactory(true) More...
 
static TEntityFactory ManuallyEnable ()
 Creates EntityFactory(false) More...
 

Detailed Description

Configures a dds::core::Entity that acts as factory of other entities.

Entity:
DomainParticipantFactory, dds::domain::DomainParticipant, dds::pub::Publisher, dds::sub::Subscriber
Properties:
RxO = NO
Changeable = YES

Usage

This policy controls the behavior of the dds::core::Entity as a factory for other entities. It controls whether or not child entities are created in the enabled state.

RTI Connext uses a factory design pattern for creating DDS Entities. That is, a parent entity must be used to create child entities. DomainParticipants create Topics, Publishers and Subscribers. Publishers create DataWriters. Subscribers create DataReaders.

By default, a child object is enabled upon creation (initialized and may be actively used). With this QoS policy, a child object can be created in a disabled state. A disabled entity is only partially initialized and cannot be used until the entity is enabled. Note: an entity can only be enabled; it cannot be disabled after it has been enabled.

This QoS policy is useful to synchronize the initialization of DDS Entities. For example, when a dds::sub::DataReader is created in an enabled state, its existence is immediately propagated for discovery and the dds::sub::DataReader object's listener called as soon as data is received. The initialization process for an application may extend beyond the creation of the dds::sub::DataReader, and thus, it may not be desireable for the dds::sub::DataReader to start to receive or process any data until the initialization process is complete. So by creating readers in a disabled state, your application can make sure that no data is received until the rest of the application initialization is complete, and at that time, enable the them.

Note: if an entity is disabled, then all of the child entities it creates will be disabled too, regardless of the setting of this QoS policy. However, enabling a disabled entity will enable all of its children if this QoS policy is set to automatically enable children entities.

This policy is mutable. A change in the policy affects only the entities created after the change, not any previously created entities.

See also
UserData

Member Function Documentation

◆ TEntityFactory() [1/2]

dds::core::policy::EntityFactory::TEntityFactory ( )
inline

Default policy.

◆ TEntityFactory() [2/2]

dds::core::policy::EntityFactory::TEntityFactory ( bool  the_auto_enable)
inlineexplicit

Specifies whether the entity acting as a factory automatically enables the instances it creates.

◆ autoenable_created_entities() [1/2]

TEntityFactory & dds::core::policy::EntityFactory::autoenable_created_entities ( bool  on)
inline

Specifies whether the entity acting as a factory automatically enables the instances it creates.

◆ autoenable_created_entities() [2/2]

bool dds::core::policy::EntityFactory::autoenable_created_entities ( ) const
inline

Getter (see setter with the same name)

◆ AutoEnable()

static TEntityFactory dds::core::policy::EntityFactory::AutoEnable ( )
inlinestatic

Creates EntityFactory(true)

◆ ManuallyEnable()

static TEntityFactory dds::core::policy::EntityFactory::ManuallyEnable ( )
inlinestatic

Creates EntityFactory(false)