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 95 of file spatem_ts_setters.h.

95 {
96 uint32_t dsecond_value_ms = (uint32_t)(dsecond_value*1e3);
97 setDSecond(dsecond, dsecond_value_ms);
98 }
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 83 of file spatem_ts_setters.h.

83 {
84 throwIfOutOfRange(dsecond_value, DSecond::MIN, DSecond::MAX, "DSecond");
85 dsecond.value = dsecond_value;
86 }
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 119 of file spatem_ts_setters.h.

119 {
120 setDSecond(intsct.time_stamp, dsecond_value);
121 intsct.time_stamp_is_present = true;
122 }

◆ 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 107 of file spatem_ts_setters.h.

107 {
108 setDSecond(intsct.time_stamp, dsecond_value);
109 intsct.time_stamp_is_present = true;
110 }

◆ 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 25 of file spatem_ts_setters.h.

25 {
26 throwIfOutOfRange(id, IntersectionID::MIN, IntersectionID::MAX, "IntersectionID");
27 intsct_id.value = id;
28 }

◆ 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 37 of file spatem_ts_setters.h.

37 {
38 setIntersectionID(intsct_ref_id.id, id);
39 }
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 48 of file spatem_ts_setters.h.

48 {
49 setIntersectionID(intsct.id, id);
50 }

◆ 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 71 of file spatem_ts_setters.h.

71 {
72 setMinuteOfTheYear(intsct.moy, moy_value);
73 intsct.moy_is_present = true;
74 }
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 59 of file spatem_ts_setters.h.

59 {
60 throwIfOutOfRange(moy_value, MinuteOfTheYear::MIN, MinuteOfTheYear::MAX, "MinuteOfTheYear");
61 moy.value = moy_value;
62 }

◆ 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 143 of file spatem_ts_setters.h.

143 {
144 setSignalGroupID(movement_state.signal_group, id);
145 }
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 131 of file spatem_ts_setters.h.

131 {
132 throwIfOutOfRange(id, SignalGroupID::MIN, SignalGroupID::MAX, "SignalGroupID");
133 signal_group_id.value = id;
134 }

◆ 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 35 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 24 of file spatem_ts_getters.h.