Class Entity

Class Documentation

class Entity

Public Functions

std::string zid() const
std::string nid() const
std::string id() const
std::size_t gid_hash() const
EntityType type() const

Get the entity type.

std::string node_namespace() const
std::string node_name() const
std::string node_enclave() const
NodeInfo node_info() const

Get the NodeInfo.

std::optional<TopicInfo> topic_info() const

Get the TopicInfo if present.

std::string liveliness_keyexpr() const

Get the liveliness keyexpr for this entity.

bool operator==(const Entity &other) const
std::array<uint8_t, RMW_GID_STORAGE_SIZE> copy_gid() const

Public Static Functions

static EntityPtr make(zenoh::Id zid, const std::string &nid, const std::string &id, EntityType type, NodeInfo node_info, std::optional<TopicInfo> topic_info = std::nullopt)

Make an Entity from datatypes. This will return nullopt if the required fields are not present for the EntityType.

Parameters:
  • zid – The zenoh session id within which this entity was created.

  • id – A unique id for this entity within the zenoh session.

  • type – The type of the entity.

  • node_info – The node information that is required for all entities.

  • topic_info – An optional topic information for relevant entities.

Returns:

An entity if all inputs are valid. This way no invalid entities can be created.

static EntityPtr make(const std::string &keyexpr)

Make an Entity from a liveliness keyexpr.