Click or drag to resize

EntityEnable Method

Enables the Entity. The enable operation is idempotent. Calling enable on an already enabled Entity returns Ok and has no effect.

Namespace:  OpenDDSharp.DDS
Assembly:  OpenDDSharp (in OpenDDSharp.dll) Version:
public ReturnCode Enable()

Return Value

Type: ReturnCode
The ReturnCode that indicates the operation result.

Entity objects can be created either enabled or disabled. This is controlled by the value of the EntityFactoryQosPolicy on the corresponding QoS for the Entity. The default setting of EntityFactoryQosPolicy is such that, by default, it is not necessary to explicitly call enable on newly created entities.

If an Entity has not yet been enabled, the following kinds of operations may be invoked on it:

  • Operations to set or get an Entity’s QoS policies (including default QoS policies) and listener
  • Access to the StatusCondition property
  • 'factory' operations
  • Access to the StatusChanges property and other status operations(although the status of a disabled entity never changes)
  • 'lookup' operations
Other operations may explicitly state that they may be called on disabled entities; those that do not will return the error NotEnabled.

It is legal to delete an Entity that has not been enabled by calling the proper operation on its factory.

Entities created from a factory that is disabled, are created disabled regardless of the setting of the EntityFactoryQosPolicy.

Calling enable on an Entity whose factory is not enabled will fail and return PreconditionNotMet.

If the EntityFactoryQosPolicy has AutoenableCreatedEntities set to , the enable operation on the factory will automatically enable all entities created from the factory.

The listeners associated with an Entity are not called until the entity is enabled.

See Also