Setter functions for the ETSI ITS SPATEM.
More...
Go to the source code of this file.
|
| 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.
|
| void | etsi_its_spatem_ts_msgs::access::throwIfNotPresent (const bool is_present, const std::string val_desc) |
| | Throws an exception if the given value is not present.
|
| void | etsi_its_spatem_ts_msgs::access::setIntersectionID (IntersectionID &intsct_id, const uint16_t id) |
| | Sets the IntersectionID value.
|
| void | etsi_its_spatem_ts_msgs::access::setIntersectionID (IntersectionReferenceID &intsct_ref_id, const uint16_t id) |
| | Sets the IntersectionID value in an IntersectionReferenceID object.
|
| void | etsi_its_spatem_ts_msgs::access::setIntersectionID (IntersectionState &intsct, const uint16_t id) |
| | Sets the IntersectionID value in an IntersectionState object.
|
| void | etsi_its_spatem_ts_msgs::access::setMinuteOfTheYear (MinuteOfTheYear &moy, const uint32_t moy_value) |
| | Sets the MinuteOfTheYear value.
|
| void | etsi_its_spatem_ts_msgs::access::setMinuteOfTheYear (IntersectionState &intsct, const uint32_t moy_value) |
| | Sets the MinuteOfTheYear value in an IntersectionState object.
|
| void | etsi_its_spatem_ts_msgs::access::setDSecond (DSecond &dsecond, const uint32_t dsecond_value) |
| | Sets the DSecond value.
|
| void | etsi_its_spatem_ts_msgs::access::setDSecond (DSecond &dsecond, const double dsecond_value) |
| | Sets the DSecond value using a double.
|
| void | etsi_its_spatem_ts_msgs::access::setDSecond (IntersectionState &intsct, const uint32_t dsecond_value) |
| | Sets the DSecond value in an IntersectionState object.
|
| void | etsi_its_spatem_ts_msgs::access::setDSecond (IntersectionState &intsct, const double dsecond_value) |
| | Sets the DSecond value in an IntersectionState object using a double.
|
| void | etsi_its_spatem_ts_msgs::access::setSignalGroupID (SignalGroupID &signal_group_id, const uint8_t id) |
| | Sets the SignalGroupID value.
|
| void | etsi_its_spatem_ts_msgs::access::setSignalGroupID (MovementState &movement_state, const uint8_t id) |
| | Sets the SignalGroupID value in a MovementState object.
|
Setter functions for the ETSI ITS SPATEM.
Definition in file spatem_ts_setters.h.
◆ setDSecond() [1/4]
| void etsi_its_spatem_ts_msgs::access::setDSecond |
( |
DSecond & | dsecond, |
|
|
const double | dsecond_value ) |
|
inline |
Sets the DSecond value using a double.
- Parameters
-
| dsecond | The DSecond object to set. |
| dsecond_value | The value to set in seconds. |
- Exceptions
-
| std::out_of_range | if the dsecond_value is out of the valid range. |
Definition at line 118 of file spatem_ts_setters.h.
118 {
119 uint32_t dsecond_value_ms = (uint32_t)(dsecond_value*1e3);
121 }
void setDSecond(DSecond &dsecond, const uint32_t dsecond_value)
Sets the DSecond value.
◆ setDSecond() [2/4]
| void etsi_its_spatem_ts_msgs::access::setDSecond |
( |
DSecond & | dsecond, |
|
|
const uint32_t | dsecond_value ) |
|
inline |
Sets the DSecond value.
- Parameters
-
| dsecond | The DSecond object to set. |
| dsecond_value | The value to set. |
- Exceptions
-
| std::out_of_range | if the dsecond_value is out of the valid range. |
Definition at line 106 of file spatem_ts_setters.h.
106 {
108 dsecond.value = dsecond_value;
109 }
void 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.
◆ setDSecond() [3/4]
| void etsi_its_spatem_ts_msgs::access::setDSecond |
( |
IntersectionState & | intsct, |
|
|
const double | dsecond_value ) |
|
inline |
Sets the DSecond value in an IntersectionState object using a double.
- Parameters
-
| intsct | The IntersectionState object to set. |
| dsecond_value | The value to set in seconds. |
- Exceptions
-
| std::out_of_range | if the dsecond_value is out of the valid range. |
Definition at line 142 of file spatem_ts_setters.h.
142 {
144 intsct.time_stamp_is_present = true;
145 }
◆ setDSecond() [4/4]
| void etsi_its_spatem_ts_msgs::access::setDSecond |
( |
IntersectionState & | intsct, |
|
|
const uint32_t | dsecond_value ) |
|
inline |
Sets the DSecond value in an IntersectionState object.
- Parameters
-
| intsct | The IntersectionState object to set. |
| dsecond_value | The value to set. |
- Exceptions
-
| std::out_of_range | if the dsecond_value is out of the valid range. |
Definition at line 130 of file spatem_ts_setters.h.
130 {
132 intsct.time_stamp_is_present = true;
133 }
◆ setIntersectionID() [1/3]
| void etsi_its_spatem_ts_msgs::access::setIntersectionID |
( |
IntersectionID & | intsct_id, |
|
|
const uint16_t | id ) |
|
inline |
Sets the IntersectionID value.
- Parameters
-
| intsct_id | The IntersectionID object to set. |
| id | The value to set. |
- Exceptions
-
| std::out_of_range | if the id is out of the valid range. |
Definition at line 48 of file spatem_ts_setters.h.
48 {
49 throwIfOutOfRange(
id, IntersectionID::MIN, IntersectionID::MAX,
"IntersectionID");
50 intsct_id.value = id;
51 }
◆ setIntersectionID() [2/3]
| void etsi_its_spatem_ts_msgs::access::setIntersectionID |
( |
IntersectionReferenceID & | intsct_ref_id, |
|
|
const uint16_t | id ) |
|
inline |
Sets the IntersectionID value in an IntersectionReferenceID object.
- Parameters
-
| intsct_ref_id | The IntersectionReferenceID object to set. |
| id | The value to set. |
- Exceptions
-
| std::out_of_range | if the id is out of the valid range. |
Definition at line 60 of file spatem_ts_setters.h.
60 {
62 }
void setIntersectionID(IntersectionID &intsct_id, const uint16_t id)
Sets the IntersectionID value.
◆ setIntersectionID() [3/3]
| void etsi_its_spatem_ts_msgs::access::setIntersectionID |
( |
IntersectionState & | intsct, |
|
|
const uint16_t | id ) |
|
inline |
Sets the IntersectionID value in an IntersectionState object.
- Parameters
-
| intsct | The IntersectionState object to set. |
| id | The value to set. |
- Exceptions
-
| std::out_of_range | if the id is out of the valid range. |
Definition at line 71 of file spatem_ts_setters.h.
◆ setMinuteOfTheYear() [1/2]
| void etsi_its_spatem_ts_msgs::access::setMinuteOfTheYear |
( |
IntersectionState & | intsct, |
|
|
const uint32_t | moy_value ) |
|
inline |
Sets the MinuteOfTheYear value in an IntersectionState object.
- Parameters
-
| intsct | The IntersectionState object to set. |
| moy_value | The value to set. |
- Exceptions
-
| std::out_of_range | if the moy_value is out of the valid range. |
Definition at line 94 of file spatem_ts_setters.h.
94 {
96 intsct.moy_is_present = true;
97 }
void setMinuteOfTheYear(MinuteOfTheYear &moy, const uint32_t moy_value)
Sets the MinuteOfTheYear value.
◆ setMinuteOfTheYear() [2/2]
| void etsi_its_spatem_ts_msgs::access::setMinuteOfTheYear |
( |
MinuteOfTheYear & | moy, |
|
|
const uint32_t | moy_value ) |
|
inline |
Sets the MinuteOfTheYear value.
- Parameters
-
| moy | The MinuteOfTheYear object to set. |
| moy_value | The value to set. |
- Exceptions
-
| std::out_of_range | if the moy_value is out of the valid range. |
Definition at line 82 of file spatem_ts_setters.h.
82 {
83 throwIfOutOfRange(moy_value, MinuteOfTheYear::MIN, MinuteOfTheYear::MAX,
"MinuteOfTheYear");
84 moy.value = moy_value;
85 }
◆ setSignalGroupID() [1/2]
| void etsi_its_spatem_ts_msgs::access::setSignalGroupID |
( |
MovementState & | movement_state, |
|
|
const uint8_t | id ) |
|
inline |
Sets the SignalGroupID value in a MovementState object.
- Parameters
-
| movement_state | The MovementState object to set. |
| id | The value to set. |
- Exceptions
-
| std::out_of_range | if the id is out of the valid range. |
Definition at line 166 of file spatem_ts_setters.h.
166 {
168 }
void setSignalGroupID(SignalGroupID &signal_group_id, const uint8_t id)
Sets the SignalGroupID value.
◆ setSignalGroupID() [2/2]
| void etsi_its_spatem_ts_msgs::access::setSignalGroupID |
( |
SignalGroupID & | signal_group_id, |
|
|
const uint8_t | id ) |
|
inline |
Sets the SignalGroupID value.
- Parameters
-
| signal_group_id | The SignalGroupID object to set. |
| id | The value to set. |
- Exceptions
-
| std::out_of_range | if the id is out of the valid range. |
Definition at line 154 of file spatem_ts_setters.h.
154 {
156 signal_group_id.value = id;
157 }
◆ 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.