scenario_simulator_v2 C++ API
simulation
traffic_simulator
include
traffic_simulator
job
job.hpp
Go to the documentation of this file.
1
// Copyright 2015 TIER IV, Inc. All rights reserved.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#ifndef TRAFFIC_SIMULATOR__JOB__JOB_HPP_
16
#define TRAFFIC_SIMULATOR__JOB__JOB_HPP_
17
18
#include <functional>
19
#include <memory>
20
21
namespace
traffic_simulator
22
{
23
namespace
job
24
{
25
enum class
Type
{
26
UNKOWN
= 0,
27
LINEAR_VELOCITY
= 1,
28
LINEAR_ACCELERATION
= 2,
29
STAND_STILL_DURATION
= 3,
30
TRAVELED_DISTANCE
= 4,
31
OUT_OF_RANGE
= 5
32
};
33
34
enum class
Status
{
35
ACTIVE
= 0,
36
INACTIVE
= 1,
37
};
38
39
enum class
Event
{
40
PRE_UPDATE
= 0,
41
POST_UPDATE
= 1,
42
};
43
44
class
Job
45
{
46
public
:
55
Job
(
56
const
std::function<
bool
(
double
)> & func_on_update,
57
const
std::function<
void
()> & func_on_cleanup,
job::Type
type
,
bool
exclusive
,
Event
event
);
58
void
onUpdate
(
const
double
step_time);
59
void
inactivate
();
60
Status
getStatus
()
const
;
61
62
private
:
63
std::function<bool(
double
)> func_on_update_;
64
std::function<void()> func_on_cleanup_;
65
Status
status_;
66
double
job_duration_;
67
68
public
:
69
const
job::Type
type
;
70
const
bool
exclusive
;
71
const
Event
event
;
72
};
73
}
// namespace job
74
}
// namespace traffic_simulator
75
76
#endif
// TRAFFIC_SIMULATOR__JOB__JOB_HPP_
traffic_simulator::job::Job
Definition:
job.hpp:45
traffic_simulator::job::Job::event
const Event event
Definition:
job.hpp:71
traffic_simulator::job::Job::Job
Job(const std::function< bool(double)> &func_on_update, const std::function< void()> &func_on_cleanup, job::Type type, bool exclusive, Event event)
Construct a new Job object.
Definition:
job.cpp:21
traffic_simulator::job::Job::getStatus
Status getStatus() const
Definition:
job.cpp:40
traffic_simulator::job::Job::inactivate
void inactivate()
Definition:
job.cpp:34
traffic_simulator::job::Job::type
const job::Type type
Definition:
job.hpp:69
traffic_simulator::job::Job::onUpdate
void onUpdate(const double step_time)
Definition:
job.cpp:42
traffic_simulator::job::Job::exclusive
const bool exclusive
Definition:
job.hpp:70
traffic_simulator::job::Event
Event
Definition:
job.hpp:39
traffic_simulator::job::Event::POST_UPDATE
@ POST_UPDATE
traffic_simulator::job::Event::PRE_UPDATE
@ PRE_UPDATE
traffic_simulator::job::Type
Type
Definition:
job.hpp:25
traffic_simulator::job::Type::LINEAR_VELOCITY
@ LINEAR_VELOCITY
traffic_simulator::job::Type::STAND_STILL_DURATION
@ STAND_STILL_DURATION
traffic_simulator::job::Type::OUT_OF_RANGE
@ OUT_OF_RANGE
traffic_simulator::job::Type::LINEAR_ACCELERATION
@ LINEAR_ACCELERATION
traffic_simulator::job::Type::TRAVELED_DISTANCE
@ TRAVELED_DISTANCE
traffic_simulator::job::Type::UNKOWN
@ UNKOWN
traffic_simulator::job::Status
Status
Definition:
job.hpp:34
traffic_simulator::job::Status::ACTIVE
@ ACTIVE
traffic_simulator::job::Status::INACTIVE
@ INACTIVE
traffic_simulator
Definition:
api.hpp:48
Generated by
1.9.1