5.4.6. EntityId

class EntityId

Public Functions

EntityId() noexcept

Instantiate an EntityId. The internal value is set to EntityId::invalid.

EntityId(int64_t value) noexcept

Instantiate an EntityId from an integer.

Parameters

value – The value to use as internal value on the EntityId

EntityId(EntityId &&entity_id) noexcept = default

Move constructor.

Parameters

entity_id – The moved EntityId

EntityId(const EntityId &entity_id) noexcept = default

Copy constructor.

Parameters

entity_id – The copied EntityId

EntityId &operator=(const EntityId &entity_id) noexcept = default

Copy assignment operator.

Parameters

entity_id – The assigned EntityId

EntityId &operator=(EntityId &&entity_id) noexcept = default

Move assignment operator.

Parameters

entity_id – The assigned EntityId

void invalidate() noexcept

Invalidate an EntityId.

Post

is_valid() returns false

bool is_valid() const noexcept

Check whether an EntityId is valid.

Returns

True if valid, false otherwise

bool is_all() const noexcept

Check whether an EntityId is the ID representing all entities.

Returns

True if is ENTITY_ID_ALL, false otherwise

bool is_valid_and_unique() const noexcept

Check whether an EntityId is an ID representing one specific entity.

Returns

True if it is valid and not ENTITY_ID_ALL, false otherwise

int64_t value() const noexcept

Get the internal value of the EntityId.

Returns

An int64_t with the representing internal value

Public Static Functions

static EntityId all() noexcept

Get the EntityId to refer all entities at once.

Returns

An ID that refers all entities.

static EntityId invalid() noexcept

Get an invalid EntityId.

Returns

An ID that is invalid

inline std::ostream &eprosima::statistics_backend::operator<<(std::ostream &output, const EntityId &entity_id)

Serialize an EntityId to std::ostream.

Parameters
  • output – The output std::ostream

  • entity_id – The EntityId to serialize

inline bool eprosima::statistics_backend::operator<(const EntityId &entity_id_1, const EntityId &entity_id_2)

Check whether an EntityId is smaller than another one.

Parameters
  • entity_id_1 – The left-side of the operation

  • entity_id_2 – The right-side of the operation

inline bool eprosima::statistics_backend::operator<=(const EntityId &entity_id_1, const EntityId &entity_id_2)

Check whether an EntityId is smaller or equal than another one.

Parameters
  • entity_id_1 – The left-side of the operation

  • entity_id_2 – The right-side of the operation

inline bool eprosima::statistics_backend::operator>(const EntityId &entity_id_1, const EntityId &entity_id_2)

Check whether an EntityId is greater than another one.

Parameters
  • entity_id_1 – The left-side of the operation

  • entity_id_2 – The right-side of the operation

inline bool eprosima::statistics_backend::operator>=(const EntityId &entity_id_1, const EntityId &entity_id_2)

Check whether an EntityId is greater or equal than another one.

Parameters
  • entity_id_1 – The left-side of the operation

  • entity_id_2 – The right-side of the operation

inline bool eprosima::statistics_backend::operator==(const EntityId &entity_id_1, const EntityId &entity_id_2)

Check whether an EntityId is equal to another one.

Parameters
  • entity_id_1 – The left-side of the operation

  • entity_id_2 – The right-side of the operation

inline bool eprosima::statistics_backend::operator!=(const EntityId &entity_id_1, const EntityId &entity_id_2)

Check whether an EntityId is different than another one.

Parameters
  • entity_id_1 – The left-side of the operation

  • entity_id_2 – The right-side of the operation