Apollo
10.0
自动驾驶开放平台
frame.h
浏览该文件的文档.
1
/******************************************************************************
2
* Copyright 2023 The Apollo Authors. All Rights Reserved.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*****************************************************************************/
16
17
#ifndef CYBER_PROFILER_FRAME_H_
18
#define CYBER_PROFILER_FRAME_H_
19
20
#include <list>
21
#include <stack>
22
#include <string>
23
24
#include "
cyber/profiler/block.h
"
25
26
namespace
apollo
{
27
namespace
cyber {
28
namespace
profiler {
29
30
class
Frame
{
31
public
:
32
void
Push
(
Block
* block);
33
Block
*
Top
();
34
void
Pop
();
35
36
bool
DumpToFile
(
const
std::string& coroutine_name);
37
void
Clear
();
38
39
std::uint32_t
size
()
const
{
return
stack_.size(); }
40
bool
finished
()
const
{
return
stack_.empty(); }
41
42
private
:
43
std::stack<Block*> stack_;
44
std::list<Block> storage_;
45
};
46
47
}
// namespace profiler
48
}
// namespace cyber
49
}
// namespace apollo
50
51
#endif
// CYBER_PROFILER_FRAME_H_
apollo::cyber::profiler::Block
Definition
block.h:27
apollo::cyber::profiler::Frame
Definition
frame.h:30
apollo::cyber::profiler::Frame::size
std::uint32_t size() const
Definition
frame.h:39
apollo::cyber::profiler::Frame::finished
bool finished() const
Definition
frame.h:40
apollo::cyber::profiler::Frame::Pop
void Pop()
Definition
frame.cc:40
apollo::cyber::profiler::Frame::Clear
void Clear()
Definition
frame.cc:61
apollo::cyber::profiler::Frame::Top
Block * Top()
Definition
frame.cc:34
apollo::cyber::profiler::Frame::Push
void Push(Block *block)
Definition
frame.cc:29
apollo::cyber::profiler::Frame::DumpToFile
bool DumpToFile(const std::string &coroutine_name)
Definition
frame.cc:49
apollo
class register implement
Definition
arena_queue.h:37
block.h
cyber
profiler
frame.h