32#ifndef ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_SETTERS_COMMON_H
33#define ETSI_ITS_MSGS_UTILS_IMPL_DENM_DENM_SETTERS_COMMON_H
37#include <etsi_its_msgs_utils/impl/asn1_primitives/asn1_primitives_setters.h>
47 DENM& denm,
const uint64_t unix_nanosecs,
51 throwIfOutOfRange(t_its.value, TimestampIts::MIN, TimestampIts::MAX,
"TimestampIts");
52 denm.denm.management.reference_time = t_its;
75 const double altitude = AltitudeValue::UNAVAILABLE) {
86 if (denm.denm.location_is_present) {
87 denm.denm.location.event_speed_is_present = presence_of_speed;
89 throw std::invalid_argument(
"LocationContainer is not present!");
100inline void setSpeed(DENM& denm,
const double speed_val,
const double confidence = std::numeric_limits<double>::infinity()) {
101 if (denm.denm.location_is_present) {
102 setSpeed(denm.denm.location.event_speed, speed_val, confidence);
105 throw std::invalid_argument(
"LocationContainer is not present!");
121inline void setFromUTMPosition(DENM& denm,
const gm::PointStamped& utm_position,
const int& zone,
const bool& northp) {
132 setBitString(driving_lane_status, bits);
142 setBitString(light_bar_siren_in_use, bits);
void setTimestampITS(TimestampIts ×tamp_its, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
Set the TimestampITS object.
Sanity-check functions etc.
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.
File containing constants that are used in the context of ETIS ITS Messages.
const std::map< uint64_t, uint16_t > LEAP_SECOND_INSERTIONS_SINCE_2004
std::map that stores all leap second insertions since 2004 with the corresponding unix-date of the in...
void setLightBarSirenInUse(LightBarSirenInUse &light_bar_siren_in_use, const std::vector< bool > &bits)
Set the Lightbar Siren In Use by a vector of bools.
void setFromUTMPosition(DENM &denm, const gm::PointStamped &utm_position, const int &zone, const bool &northp)
Set the ReferencePosition of a DENM from a given UTM-Position.
void setSpeed(DENM &denm, const double speed_val, const double confidence=std::numeric_limits< double >::infinity())
Set the vehicle speed.
void setStationType(DENM &denm, const int value)
Set the StationType for a DENM.
void setIsSpeedPresent(DENM &denm, bool presence_of_speed)
Set the IsSpeedPresent object for DENM.
void setReferencePosition(DENM &denm, const double latitude, const double longitude, const double altitude=AltitudeValue::UNAVAILABLE)
Set the ReferencePositionWithConfidence for a DENM.
void setReferenceTime(DENM &denm, const uint64_t unix_nanosecs, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
Set the ReferenceTime-value.
void setDrivingLaneStatus(DrivingLaneStatus &driving_lane_status, const std::vector< bool > &bits)
Set the Driving Lane Status by a vector of bools.