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

#include <block.h>

apollo::cyber::profiler::Block 的协作图:

Public 类型

using time_point = std::chrono::time_point< std::chrono::steady_clock >
 

Public 成员函数

 Block ()
 
 Block (const std::string &name)
 
virtual ~Block ()
 
void Start ()
 
void End ()
 
const std::string & name () const
 
std::uint32_t depth () const
 
void set_depth (std::uint32_t depth)
 
const time_pointbegin_time () const
 
const time_pointend_time () const
 
std::uint64_t begin_time_since_epoch () const
 
std::uint64_t end_time_since_epoch () const
 
std::uint64_t duration () const
 
bool finished () const
 

详细描述

在文件 block.h27 行定义.

成员类型定义说明

◆ time_point

using apollo::cyber::profiler::Block::time_point = std::chrono::time_point<std::chrono::steady_clock>

在文件 block.h29 行定义.

构造及析构函数说明

◆ Block() [1/2]

apollo::cyber::profiler::Block::Block ( )

在文件 block.cc25 行定义.

25: depth_(0), begin_time_(), end_time_() {}

◆ Block() [2/2]

apollo::cyber::profiler::Block::Block ( const std::string &  name)
explicit

在文件 block.cc27 行定义.

28 : name_(name), depth_(0), begin_time_(), end_time_() {}
const std::string & name() const
Definition block.h:39

◆ ~Block()

apollo::cyber::profiler::Block::~Block ( )
virtual

在文件 block.cc30 行定义.

30 {
31 if (!finished())
32 BlockManager::Instance()->EndBlock();
33}

成员函数说明

◆ begin_time()

const time_point & apollo::cyber::profiler::Block::begin_time ( ) const
inline

在文件 block.h43 行定义.

43{ return begin_time_; }

◆ begin_time_since_epoch()

std::uint64_t apollo::cyber::profiler::Block::begin_time_since_epoch ( ) const

在文件 block.cc43 行定义.

43 {
44 return std::chrono::duration_cast<std::chrono::nanoseconds>(
45 begin_time_.time_since_epoch()).count();
46}

◆ depth()

std::uint32_t apollo::cyber::profiler::Block::depth ( ) const
inline

在文件 block.h40 行定义.

40{ return depth_; }

◆ duration()

std::uint64_t apollo::cyber::profiler::Block::duration ( ) const

在文件 block.cc53 行定义.

53 {
54 return std::chrono::duration_cast<std::chrono::nanoseconds>(
55 end_time_ - begin_time_).count();
56}

◆ End()

void apollo::cyber::profiler::Block::End ( )

在文件 block.cc39 行定义.

39 {
40 end_time_ = std::chrono::steady_clock::now();
41}

◆ end_time()

const time_point & apollo::cyber::profiler::Block::end_time ( ) const
inline

在文件 block.h44 行定义.

44{ return end_time_; }

◆ end_time_since_epoch()

std::uint64_t apollo::cyber::profiler::Block::end_time_since_epoch ( ) const

在文件 block.cc48 行定义.

48 {
49 return std::chrono::duration_cast<std::chrono::nanoseconds>(
50 end_time_.time_since_epoch()).count();
51}

◆ finished()

bool apollo::cyber::profiler::Block::finished ( ) const
inline

在文件 block.h50 行定义.

50{ return end_time_ > begin_time_; }

◆ name()

const std::string & apollo::cyber::profiler::Block::name ( ) const
inline

在文件 block.h39 行定义.

39{ return name_; }

◆ set_depth()

void apollo::cyber::profiler::Block::set_depth ( std::uint32_t  depth)
inline

在文件 block.h41 行定义.

41{ depth_ = depth; }
std::uint32_t depth() const
Definition block.h:40

◆ Start()

void apollo::cyber::profiler::Block::Start ( )

在文件 block.cc35 行定义.

35 {
36 begin_time_ = std::chrono::steady_clock::now();
37}

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