Apollo 10.0
自动驾驶开放平台
timer_component.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 CYBER_COMPONENT_TIMER_COMPONENT_H_
18#define CYBER_COMPONENT_TIMER_COMPONENT_H_
19
20#include <memory>
21
23
24namespace apollo {
25namespace cyber {
26
27class Timer;
28
36 public:
38 ~TimerComponent() override;
39
47 bool Initialize(const TimerComponentConfig& config) override;
48 void Clear() override;
49 bool Process();
50 uint32_t GetInterval() const;
51
52 private:
58 virtual bool Proc() = 0;
59
60 uint32_t interval_ = 0;
61 std::unique_ptr<Timer> timer_;
62};
63
64} // namespace cyber
65} // namespace apollo
66
67#endif // CYBER_COMPONENT_TIMER_COMPONENT_H_
bool Initialize(const TimerComponentConfig &config) override
init the component by protobuf object.
class register implement
Definition arena_queue.h:37