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
25
26namespace apollo {
27namespace cyber {
28namespace profiler {
29
30class 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_
std::uint32_t size() const
Definition frame.h:39
void Push(Block *block)
Definition frame.cc:29
bool DumpToFile(const std::string &coroutine_name)
Definition frame.cc:49
class register implement
Definition arena_queue.h:37