Getter functions for the ETSI ITS SPATEM.
More...
Go to the source code of this file.
Getter functions for the ETSI ITS SPATEM.
Definition in file spatem_ts_getters.h.
◆ getCurrentMovementEvent()
| MovementEvent etsi_its_spatem_ts_msgs::access::getCurrentMovementEvent |
( |
const MovementState & | mvmt_state | ) |
|
|
inline |
Get the current MovementEvent of a given MovementState object.
- Parameters
-
| mvmt_event | MovementState object to get the MovementEvent from |
- Returns
- MovementEvent object
Definition at line 138 of file spatem_ts_getters.h.
138 {
139 if(mvmt_state.state_time_speed.array.size()<=0) {
140 throw std::runtime_error("MovementEventList is empty.");
141 }
142 return mvmt_state.state_time_speed.array[0];
143 }
◆ getCurrentMovementPhaseState()
| MovementPhaseState etsi_its_spatem_ts_msgs::access::getCurrentMovementPhaseState |
( |
const MovementState & | mvmt_state | ) |
|
|
inline |
Get the Current MovementPhaseState object of a given MovementState object.
- Parameters
-
| mvmt_state | MovementState object to get the MovementPhaseState from |
- Returns
- MovementPhaseState object
Definition at line 151 of file spatem_ts_getters.h.
151 {
153 }
MovementEvent getCurrentMovementEvent(const MovementState &mvmt_state)
Get the current MovementEvent of a given MovementState object.
◆ getCurrentMovementPhaseStateValue()
| uint8_t etsi_its_spatem_ts_msgs::access::getCurrentMovementPhaseStateValue |
( |
const MovementState & | mvmt_state | ) |
|
|
inline |
Get the Current MovementPhaseState object of a given MovementState object.
- Parameters
-
| mvmt_state | MovementState object to get the MovementPhaseState from |
- Returns
- MovementPhaseState object
Definition at line 161 of file spatem_ts_getters.h.
161 {
163 }
MovementPhaseState getCurrentMovementPhaseState(const MovementState &mvmt_state)
Get the Current MovementPhaseState object of a given MovementState object.
◆ getDSecond()
| DSecond etsi_its_spatem_ts_msgs::access::getDSecond |
( |
const IntersectionState & | intsct | ) |
|
|
inline |
Get the DSecond object from a given IntersectionState object.
- Parameters
-
| intsct | IntersectionState object to get the DSecond from |
- Returns
- DSecond object
Definition at line 87 of file spatem_ts_getters.h.
87 {
89 return intsct.time_stamp;
90 }
void throwIfNotPresent(const bool is_present, const std::string val_desc)
Throws an exception if the given value is not present.
◆ getDSecondValue() [1/2]
| double etsi_its_spatem_ts_msgs::access::getDSecondValue |
( |
const DSecond & | dsecond | ) |
|
|
inline |
Get the value of a DSecond object in seconds.
- Parameters
-
| dsecond | DSecond object to get the value from |
- Returns
- double value of DSecond given in seconds
Definition at line 98 of file spatem_ts_getters.h.
98 {
99 return ((double)dsecond.value)*1e-3;
100 }
◆ getDSecondValue() [2/2]
| double etsi_its_spatem_ts_msgs::access::getDSecondValue |
( |
const IntersectionState & | intsct | ) |
|
|
inline |
Get the value of an DSecond object from a given IntersectionState object.
- Parameters
-
- Returns
- double
Definition at line 108 of file spatem_ts_getters.h.
108 {
110 }
double getDSecondValue(const DSecond &dsecond)
Get the value of a DSecond object in seconds.
DSecond getDSecond(const IntersectionState &intsct)
Get the DSecond object from a given IntersectionState object.
◆ getIntersectionID() [1/3]
| uint16_t etsi_its_spatem_ts_msgs::access::getIntersectionID |
( |
const IntersectionID & | intsct_id | ) |
|
|
inline |
Get the intersection-id.
- Parameters
-
| intsct_id | intersection-id object to get the value from |
- Returns
- uint16_t id of the intersection
Definition at line 46 of file spatem_ts_getters.h.
46 {
47 return intsct_id.value;
48 }
◆ getIntersectionID() [2/3]
| uint16_t etsi_its_spatem_ts_msgs::access::getIntersectionID |
( |
const IntersectionReferenceID & | intsct_ref_id | ) |
|
|
inline |
Get the intersection-id of an IntersectionReferenceID object.
- Parameters
-
| intsct_ref_id | IntersectionReferenceID object |
- Returns
- uint16_t id of the intersection
Definition at line 56 of file spatem_ts_getters.h.
56 {
58 }
uint16_t getIntersectionID(const IntersectionID &intsct_id)
Get the intersection-id.
◆ getIntersectionID() [3/3]
| uint16_t etsi_its_spatem_ts_msgs::access::getIntersectionID |
( |
const IntersectionState & | intsct | ) |
|
|
inline |
Get the intersection-id of an IntersectionState object.
- Parameters
-
| intsct | IntersectionState object |
- Returns
- uint16_t id of the intersection
Definition at line 66 of file spatem_ts_getters.h.
◆ getMinuteOfTheYear()
| MinuteOfTheYear etsi_its_spatem_ts_msgs::access::getMinuteOfTheYear |
( |
const IntersectionState & | intsct | ) |
|
|
inline |
Get the MinuteOfTheYear object from a given IntersectionState object.
- Parameters
-
| intsct | IntersectionState object to get the MinuteOfTheYear from |
- Returns
- MinuteOfTheYear object
Definition at line 76 of file spatem_ts_getters.h.
76 {
78 return intsct.moy;
79 }
◆ getSignalGroupID() [1/2]
| uint8_t etsi_its_spatem_ts_msgs::access::getSignalGroupID |
( |
const MovementState & | mvmt_state | ) |
|
|
inline |
Get the Signal Group-ID of an MovementState object.
- Parameters
-
| mvmt_state | MovementState object to get the id from |
- Returns
- uint8_t the id of the signal group
Definition at line 128 of file spatem_ts_getters.h.
128 {
130 }
uint8_t getSignalGroupID(const SignalGroupID &signal_group_id)
Get the Signal Group-ID of an SignalGroupID object.
◆ getSignalGroupID() [2/2]
| uint8_t etsi_its_spatem_ts_msgs::access::getSignalGroupID |
( |
const SignalGroupID & | signal_group_id | ) |
|
|
inline |
Get the Signal Group-ID of an SignalGroupID object.
- Parameters
-
| signal_group_id | SignalGroupID object to get the id from |
- Returns
- uint8_t the id of the signal group
Definition at line 118 of file spatem_ts_getters.h.
118 {
119 return signal_group_id.value;
120 }
◆ throwIfNotPresent()
| void etsi_its_spatem_ts_msgs::access::throwIfNotPresent |
( |
const bool | is_present, |
|
|
const std::string | val_desc ) |
|
inline |
Throws an exception if the given value is not present.
- Parameters
-
| is_present | Whether the value is present. |
| val_desc | Description of the value for the exception message. |
Definition at line 58 of file spatem_ts_getters.h.
◆ throwIfOutOfRange()
template<typename T1, typename T2>
| void etsi_its_spatem_ts_msgs::access::throwIfOutOfRange |
( |
const T1 & | val, |
|
|
const T2 & | min, |
|
|
const T2 & | max, |
|
|
const std::string | val_desc ) |
Throws an exception if a given value is out of a defined range.
- Template Parameters
-
- Parameters
-
| val | The value to check if it is in the range. |
| min | The minimum value of the range. |
| max | The maximum value of the range. |
| val_desc | Description of the value for the exception message. |
Definition at line 47 of file spatem_ts_getters.h.