17 #ifndef CYBER_SERVICE_DISCOVERY_ROLE_ROLE_H_ 18 #define CYBER_SERVICE_DISCOVERY_ROLE_ROLE_H_ 24 #include "cyber/proto/role_attributes.pb.h" 28 namespace service_discovery {
31 using RolePtr = std::shared_ptr<RoleBase>;
48 explicit RoleBase(
const proto::RoleAttributes& attr,
52 virtual bool Match(
const proto::RoleAttributes& target_attr)
const;
69 explicit RoleWriter(
const proto::RoleAttributes& attr,
73 bool Match(
const proto::RoleAttributes& target_attr)
const override;
79 explicit RoleServer(
const proto::RoleAttributes& attr,
83 bool Match(
const proto::RoleAttributes& target_attr)
const override;
90 #endif // CYBER_SERVICE_DISCOVERY_ROLE_ROLE_H_ std::shared_ptr< RoleWriter > RoleWriterPtr
Definition: role.h:36
uint64_t timestamp_ns() const
Definition: role.h:58
std::shared_ptr< RoleServer > RoleServerPtr
Definition: role.h:41
virtual bool Match(const proto::RoleAttributes &target_attr) const
RoleServer()
Definition: role.h:78
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
RoleWriter()
Definition: role.h:68
bool IsEarlierThan(const RoleBase &other) const
std::shared_ptr< RoleNode > RoleNodePtr
Definition: role.h:33
void set_attributes(const proto::RoleAttributes &attr)
Definition: role.h:56
std::shared_ptr< RoleBase > RolePtr
Definition: role.h:31
virtual ~RoleBase()=default
const proto::RoleAttributes & attributes() const
Definition: role.h:55
std::shared_ptr< RoleReader > RoleReaderPtr
Definition: role.h:38
proto::RoleAttributes attributes_
Definition: role.h:62
uint64_t timestamp_ns_
Definition: role.h:63
void set_timestamp_ns(uint64_t timestamp_ns)
Definition: role.h:59
std::shared_ptr< RoleClient > RoleClientPtr
Definition: role.h:43