etsi_its_messages v3.4.0
Loading...
Searching...
No Matches
spatem_ts_setters.h File Reference

Setter functions for the ETSI ITS SPATEM. More...

Go to the source code of this file.

Functions

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.

Detailed Description

Setter functions for the ETSI ITS SPATEM.

Definition in file spatem_ts_setters.h.

Function Documentation

◆ 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
dsecondThe DSecond object to set.
dsecond_valueThe value to set in seconds.
Exceptions
std::out_of_rangeif 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);
120 setDSecond(dsecond, dsecond_value_ms);
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
dsecondThe DSecond object to set.
dsecond_valueThe value to set.
Exceptions
std::out_of_rangeif the dsecond_value is out of the valid range.

Definition at line 106 of file spatem_ts_setters.h.

106 {
107 throwIfOutOfRange(dsecond_value, DSecond::MIN, DSecond::MAX, "DSecond");
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
intsctThe IntersectionState object to set.
dsecond_valueThe value to set in seconds.
Exceptions
std::out_of_rangeif the dsecond_value is out of the valid range.

Definition at line 142 of file spatem_ts_setters.h.

142 {
143 setDSecond(intsct.time_stamp, dsecond_value);
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
intsctThe IntersectionState object to set.
dsecond_valueThe value to set.
Exceptions
std::out_of_rangeif the dsecond_value is out of the valid range.

Definition at line 130 of file spatem_ts_setters.h.

130 {
131 setDSecond(intsct.time_stamp, dsecond_value);
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_idThe IntersectionID object to set.
idThe value to set.
Exceptions
std::out_of_rangeif 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_idThe IntersectionReferenceID object to set.
idThe value to set.
Exceptions
std::out_of_rangeif the id is out of the valid range.

Definition at line 60 of file spatem_ts_setters.h.

60 {
61 setIntersectionID(intsct_ref_id.id, id);
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
intsctThe IntersectionState object to set.
idThe value to set.
Exceptions
std::out_of_rangeif the id is out of the valid range.

Definition at line 71 of file spatem_ts_setters.h.

71 {
72 setIntersectionID(intsct.id, id);
73 }

◆ 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
intsctThe IntersectionState object to set.
moy_valueThe value to set.
Exceptions
std::out_of_rangeif the moy_value is out of the valid range.

Definition at line 94 of file spatem_ts_setters.h.

94 {
95 setMinuteOfTheYear(intsct.moy, moy_value);
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
moyThe MinuteOfTheYear object to set.
moy_valueThe value to set.
Exceptions
std::out_of_rangeif 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_stateThe MovementState object to set.
idThe value to set.
Exceptions
std::out_of_rangeif the id is out of the valid range.

Definition at line 166 of file spatem_ts_setters.h.

166 {
167 setSignalGroupID(movement_state.signal_group, id);
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_idThe SignalGroupID object to set.
idThe value to set.
Exceptions
std::out_of_rangeif the id is out of the valid range.

Definition at line 154 of file spatem_ts_setters.h.

154 {
155 throwIfOutOfRange(id, SignalGroupID::MIN, SignalGroupID::MAX, "SignalGroupID");
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_presentWhether the value is present.
val_descDescription 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
T1
T2
Parameters
valThe value to check if it is in the range.
minThe minimum value of the range.
maxThe maximum value of the range.
val_descDescription of the value for the exception message.

Definition at line 47 of file spatem_ts_getters.h.