Apollo 10.0
自动驾驶开放平台
renderable_message.h
浏览该文件的文档.
1/******************************************************************************
2 * Copyright 2018 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 TOOLS_CVT_MONITOR_RENDERABLE_MESSAGE_H_
18#define TOOLS_CVT_MONITOR_RENDERABLE_MESSAGE_H_
19
20#include <string>
21
22class Screen;
23
25 public:
26 static constexpr int FrameRatio_Precision = 2;
27
29 int line_no = 0)
31 pages_(1),
32 page_index_(0),
35 frame_ratio_(0.0) {}
36
37 virtual ~RenderableMessage() { parent_ = nullptr; }
38
39 virtual int Render(const Screen* s, int key) = 0;
40 virtual RenderableMessage* Child(int /* line_no */) const = 0;
41
42 virtual double frame_ratio(void) { return frame_ratio_; }
43
44 RenderableMessage* parent(void) const { return parent_; }
46 if (parent == parent_) {
47 return;
48 }
50 }
51
52 int page_item_count(void) const { return page_item_count_; }
53
54 protected:
55 int* line_no(void) { return &line_no_; }
57 void reset_line_page(void) {
58 line_no_ = 0;
59 page_index_ = 0;
60 }
61 void SplitPages(int key);
62
64 int pages_;
69
70 friend class Screen;
71}; // RenderableMessage
72
73#endif // TOOLS_CVT_MONITOR_RENDERABLE_MESSAGE_H_
virtual int Render(const Screen *s, int key)=0
void set_line_no(int line_no)
void set_parent(RenderableMessage *parent)
RenderableMessage * parent_
int page_item_count(void) const
RenderableMessage * parent(void) const
virtual double frame_ratio(void)
RenderableMessage(RenderableMessage *parent=nullptr, int line_no=0)
virtual RenderableMessage * Child(int) const =0
static constexpr int FrameRatio_Precision