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
22
#include "
cyber/component/component_base.h
"
23
24
namespace
apollo
{
25
namespace
cyber {
26
27
class
Timer;
28
35
class
TimerComponent
:
public
ComponentBase
{
36
public
:
37
TimerComponent
();
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_
apollo::cyber::ComponentBase
Definition
component_base.h:41
apollo::cyber::TimerComponent
Definition
timer_component.h:35
apollo::cyber::TimerComponent::~TimerComponent
~TimerComponent() override
Definition
timer_component.cc:27
apollo::cyber::TimerComponent::GetInterval
uint32_t GetInterval() const
Definition
timer_component.cc:70
apollo::cyber::TimerComponent::Clear
void Clear() override
Definition
timer_component.cc:68
apollo::cyber::TimerComponent::Process
bool Process()
Definition
timer_component.cc:29
apollo::cyber::TimerComponent::Initialize
bool Initialize(const TimerComponentConfig &config) override
init the component by protobuf object.
Definition
timer_component.cc:36
apollo::cyber::TimerComponent::TimerComponent
TimerComponent()
Definition
timer_component.cc:25
component_base.h
apollo
class register implement
Definition
arena_queue.h:37
apollo::cyber::proto::TimerComponentConfig
Definition
component_conf.proto:20
cyber
component
timer_component.h