Class UniquePortId

Inheritance Relationships

Base Type

  • public cxx::NewType< uint64_t, cxx::newtype::ProtectedConstructByValueCopy, cxx::newtype::Comparable, cxx::newtype::Sortable, cxx::newtype::Convertable, cxx::newtype::CopyConstructable, cxx::newtype::MoveConstructable, cxx::newtype::CopyAssignable, cxx::newtype::MoveAssignable >

Class Documentation

class UniquePortId : public cxx::NewType<uint64_t, cxx::newtype::ProtectedConstructByValueCopy, cxx::newtype::Comparable, cxx::newtype::Sortable, cxx::newtype::Convertable, cxx::newtype::CopyConstructable, cxx::newtype::MoveConstructable, cxx::newtype::CopyAssignable, cxx::newtype::MoveAssignable>

A counter which is monotonically advancing with each newly created instance of UniquePortId. Additionally it contains a unique RouDi id to be able to differentiate the sample sources in a multi publisher multi subscriber pattern where samples are exchanged over network via a third party middleware. The unique RouDi id must be set manually when RouDi is started and it must be ensured to be unique for a given instance for this feature to be used to its full extend.

Public Functions

UniquePortId() noexcept

The constructor creates an id which is greater than the previous created id.

UniquePortId(InvalidPortId_t) noexcept

Constructor which creates an invalid id.

bool isValid() const noexcept

Indicates whether the object contains an invalid port id.

Returns:

true if a valid id is present, false otherwise

Public Static Functions

static void setUniqueRouDiId(const uint16_t id) noexcept

Has to be set on RouDi startup so that a unique RouDi id is set for all newly generated unique ids. If you call it when a unique id is already set, an error is generated in the errorHandler.

Parameters:

id[in] the unique id which you would like to set

static uint16_t getUniqueRouDiId() noexcept

Getter for the unique roudi id.

Returns:

value of the unique roudi id