Apollo 10.0
自动驾驶开放平台
apollo::cyber::service_discovery::RoleBase类 参考

#include <role.h>

类 apollo::cyber::service_discovery::RoleBase 继承关系图:
apollo::cyber::service_discovery::RoleBase 的协作图:

Public 成员函数

 RoleBase ()
 
 RoleBase (const proto::RoleAttributes &attr, uint64_t timestamp_ns=0)
 
virtual ~RoleBase ()=default
 
virtual bool Match (const proto::RoleAttributes &target_attr) const
 
bool IsEarlierThan (const RoleBase &other) const
 
const proto::RoleAttributesattributes () const
 
void set_attributes (const proto::RoleAttributes &attr)
 
uint64_t timestamp_ns () const
 
void set_timestamp_ns (uint64_t timestamp_ns)
 

Protected 属性

proto::RoleAttributes attributes_
 
uint64_t timestamp_ns_
 

详细描述

在文件 role.h45 行定义.

构造及析构函数说明

◆ RoleBase() [1/2]

apollo::cyber::service_discovery::RoleBase::RoleBase ( )

在文件 role.cc27 行定义.

◆ RoleBase() [2/2]

apollo::cyber::service_discovery::RoleBase::RoleBase ( const proto::RoleAttributes attr,
uint64_t  timestamp_ns = 0 
)
explicit

在文件 role.cc29 行定义.

◆ ~RoleBase()

virtual apollo::cyber::service_discovery::RoleBase::~RoleBase ( )
virtualdefault

成员函数说明

◆ attributes()

const proto::RoleAttributes & apollo::cyber::service_discovery::RoleBase::attributes ( ) const
inline

在文件 role.h55 行定义.

55{ return attributes_; }

◆ IsEarlierThan()

bool apollo::cyber::service_discovery::RoleBase::IsEarlierThan ( const RoleBase other) const

在文件 role.cc51 行定义.

51 {
52 return timestamp_ns_ < other.timestamp_ns();
53}

◆ Match()

bool apollo::cyber::service_discovery::RoleBase::Match ( const proto::RoleAttributes target_attr) const
virtual

apollo::cyber::service_discovery::RoleWriter , 以及 apollo::cyber::service_discovery::RoleServer 重载.

在文件 role.cc32 行定义.

32 {
33 if (target_attr.has_node_id() &&
34 target_attr.node_id() != attributes_.node_id()) {
35 return false;
36 }
37
38 if (target_attr.has_process_id() &&
39 target_attr.process_id() != attributes_.process_id()) {
40 return false;
41 }
42
43 if (target_attr.has_host_name() &&
44 target_attr.host_name() != attributes_.host_name()) {
45 return false;
46 }
47
48 return true;
49}

◆ set_attributes()

void apollo::cyber::service_discovery::RoleBase::set_attributes ( const proto::RoleAttributes attr)
inline

在文件 role.h56 行定义.

56{ attributes_ = attr; }

◆ set_timestamp_ns()

void apollo::cyber::service_discovery::RoleBase::set_timestamp_ns ( uint64_t  timestamp_ns)
inline

在文件 role.h59 行定义.

◆ timestamp_ns()

uint64_t apollo::cyber::service_discovery::RoleBase::timestamp_ns ( ) const
inline

在文件 role.h58 行定义.

58{ return timestamp_ns_; }

类成员变量说明

◆ attributes_

proto::RoleAttributes apollo::cyber::service_discovery::RoleBase::attributes_
protected

在文件 role.h62 行定义.

◆ timestamp_ns_

uint64_t apollo::cyber::service_discovery::RoleBase::timestamp_ns_
protected

在文件 role.h63 行定义.


该类的文档由以下文件生成: