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

#include <identity.h>

apollo::cyber::transport::Identity 的协作图:

Public 成员函数

 Identity (bool need_generate=true)
 
 Identity (const Identity &another)
 
virtual ~Identity ()
 
Identityoperator= (const Identity &another)
 
bool operator== (const Identity &another) const
 
bool operator!= (const Identity &another) const
 
std::string ToString () const
 
size_t Length () const
 
uint64_t HashValue () const
 
const char * data () const
 
void set_data (const char *data)
 

详细描述

在文件 identity.h30 行定义.

构造及析构函数说明

◆ Identity() [1/2]

apollo::cyber::transport::Identity::Identity ( bool  need_generate = true)
explicit

在文件 identity.cc27 行定义.

27 : hash_value_(0) {
28 std::memset(data_, 0, ID_SIZE);
29 if (need_generate) {
30 uuid_t uuid;
31 uuid_generate(uuid);
32 std::memcpy(data_, uuid, ID_SIZE);
33 Update();
34 }
35}
constexpr uint8_t ID_SIZE
Definition identity.h:28

◆ Identity() [2/2]

apollo::cyber::transport::Identity::Identity ( const Identity another)

在文件 identity.cc37 行定义.

37 {
38 std::memcpy(data_, rhs.data_, ID_SIZE);
39 hash_value_ = rhs.hash_value_;
40}

◆ ~Identity()

apollo::cyber::transport::Identity::~Identity ( )
virtual

在文件 identity.cc42 行定义.

42{}

成员函数说明

◆ data()

const char * apollo::cyber::transport::Identity::data ( ) const
inline

在文件 identity.h44 行定义.

44{ return data_; }

◆ HashValue()

uint64_t apollo::cyber::transport::Identity::HashValue ( ) const

在文件 identity.cc64 行定义.

64{ return hash_value_; }

◆ Length()

size_t apollo::cyber::transport::Identity::Length ( ) const

在文件 identity.cc62 行定义.

62{ return ID_SIZE; }

◆ operator!=()

bool apollo::cyber::transport::Identity::operator!= ( const Identity another) const

在文件 identity.cc56 行定义.

56 {
57 return std::memcmp(data_, rhs.data_, ID_SIZE) != 0;
58}

◆ operator=()

Identity & apollo::cyber::transport::Identity::operator= ( const Identity another)

在文件 identity.cc44 行定义.

44 {
45 if (this != &rhs) {
46 std::memcpy(data_, rhs.data_, ID_SIZE);
47 hash_value_ = rhs.hash_value_;
48 }
49 return *this;
50}

◆ operator==()

bool apollo::cyber::transport::Identity::operator== ( const Identity another) const

在文件 identity.cc52 行定义.

52 {
53 return std::memcmp(data_, rhs.data_, ID_SIZE) == 0;
54}

◆ set_data()

void apollo::cyber::transport::Identity::set_data ( const char *  data)
inline

在文件 identity.h45 行定义.

45 {
46 if (data == nullptr) {
47 return;
48 }
49 std::memcpy(data_, data, sizeof(data_));
50 Update();
51 }
const char * data() const
Definition identity.h:44

◆ ToString()

std::string apollo::cyber::transport::Identity::ToString ( ) const

在文件 identity.cc60 行定义.

60{ return std::to_string(hash_value_); }

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