etsi_its_messages v3.1.0
 
Loading...
Searching...
No Matches
cam_ts_access.h File Reference

Main CAM TS access implementation header. More...

#include <cstring>
#include <iostream>
#include <map>
#include <GeographicLib/UTMUPS.hpp>
#include <etsi_its_msgs_utils/impl/constants.h>
#include <etsi_its_msgs_utils/impl/cam/cam_ts_getters.h>
#include <etsi_its_msgs_utils/impl/cam/cam_ts_setters.h>
#include <etsi_its_msgs_utils/impl/cam/cam_utils.h>

Go to the source code of this file.

Classes

struct  etsi_its_cam_ts_msgs::access::etsi_its_msgs::OneCentimeterHelper< SemiAxisLength, typename >
 
struct  etsi_its_cam_ts_msgs::access::etsi_its_msgs::OneCentimeterHelper< SemiAxisLength, std::void_t< decltype(SemiAxisLength::ONE_CENTIMETER)> >
 

Functions

template<typename T1, typename T2>
void etsi_its_cam_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_cam_ts_msgs::access::throwIfNotPresent (const bool is_present, const std::string val_desc)
 Throws an exception if the given value is not present.
 
uint16_t etsi_its_cam_ts_msgs::access::etsi_its_msgs::getLeapSecondInsertionsSince2004 (const uint64_t unix_seconds)
 Get the leap second insertions since 2004 for given unix seconds.
 
TimestampIts etsi_its_cam_ts_msgs::access::getTimestampITSFromGenerationDeltaTime (const GenerationDeltaTime &generation_delta_time, const TimestampIts &timestamp_estimate)
 Get the TimestampITS from a given GenerationDeltaTime object.
 
uint64_t etsi_its_cam_ts_msgs::access::getUnixNanosecondsFromGenerationDeltaTime (const GenerationDeltaTime &generation_delta_time, const TimestampIts &timestamp_estimate, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
 Get the Unix-Nanoseconds from a given GenerationDeltaTime object.
 
uint64_t etsi_its_cam_ts_msgs::access::getUnixNanosecondsFromGenerationDeltaTime (const GenerationDeltaTime &generation_delta_time, const uint64_t unix_timestamp_estimate, const uint16_t n_leap_seconds=etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin() ->second)
 Get the Unix Nanoseconds from Generation Delta Time object.
 

Variables

const uint64_t etsi_its_cam_ts_msgs::access::etsi_its_msgs::UNIX_SECONDS_2004 = 1072915200
 
const std::map< uint64_t, uint16_t > etsi_its_cam_ts_msgs::access::etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004
 std::map that stores all leap second insertions since 2004 with the corresponding unix-date of the insertion
 
constexpr const double etsi_its_cam_ts_msgs::access::etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR = 2.0
 
constexpr const double etsi_its_cam_ts_msgs::access::etsi_its_msgs::TWO_D_GAUSSIAN_FACTOR = 2.4477
 

Detailed Description

Main CAM TS access implementation header.

Definition in file cam_ts_access.h.

Function Documentation

◆ getLeapSecondInsertionsSince2004()

uint16_t etsi_its_cam_ts_msgs::access::etsi_its_msgs::getLeapSecondInsertionsSince2004 ( const uint64_t unix_seconds)
inline

Get the leap second insertions since 2004 for given unix seconds.

Parameters
unix_secondsthe current unix seconds for that the leap second insertions since 2004 shall be provided
Returns
uint16_t the number of leap second insertions since 2004 for unix_seconds

Definition at line 61 of file cam_ts_access.h.

◆ getTimestampITSFromGenerationDeltaTime()

TimestampIts etsi_its_cam_ts_msgs::access::getTimestampITSFromGenerationDeltaTime ( const GenerationDeltaTime & generation_delta_time,
const TimestampIts & timestamp_estimate )
inline

Get the TimestampITS from a given GenerationDeltaTime object.

Parameters
generation_delta_timethe GenerationDeltaTime object to get the TimestampITS from
timestamp_estimateestimated time to calculate the corresponding generation from
Returns
TimestampIts the corresponding TimestampITS object

Definition at line 105 of file cam_ts_access.h.

161 {
163}
Utility functions for the ETSI ITS CAM (EN and TS)

◆ getUnixNanosecondsFromGenerationDeltaTime() [1/2]

uint64_t etsi_its_cam_ts_msgs::access::getUnixNanosecondsFromGenerationDeltaTime ( const GenerationDeltaTime & generation_delta_time,
const TimestampIts & timestamp_estimate,
const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin()->second )
inline

Get the Unix-Nanoseconds from a given GenerationDeltaTime object.

Parameters
generation_delta_timethe GenerationDeltaTime object to get the Unix-Nanoseconds from
timestamp_estimateestimated time to calculate the corresponding generation from
n_leap_secondsnumber of leap-seconds since 2004. (Defaults to the todays number of leap seconds since 2004.)
Returns
uint64_t the corresponding Unix-Nanoseconds

Definition at line 121 of file cam_ts_access.h.

177 {
179}

◆ getUnixNanosecondsFromGenerationDeltaTime() [2/2]

uint64_t etsi_its_cam_ts_msgs::access::getUnixNanosecondsFromGenerationDeltaTime ( const GenerationDeltaTime & generation_delta_time,
const uint64_t unix_timestamp_estimate,
const uint16_t n_leap_seconds = etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004.rbegin()->second )
inline

Get the Unix Nanoseconds from Generation Delta Time object.

Parameters
generation_delta_timethe GenerationDeltaTime object to get the Unix-Nanoseconds from
unix_timestamp_estimateestimated unix-time (in Nanoseconds) to calculate the corresponding generation from
n_leap_secondsnumber of leap-seconds since 2004. (Defaults to the todays number of leap seconds since 2004.)
Returns
uint64_t the corresponding Unix-Nanoseconds

Definition at line 136 of file cam_ts_access.h.

192 {
194}

◆ throwIfNotPresent()

void etsi_its_cam_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 cam_ts_access.h.

◆ throwIfOutOfRange()

template<typename T1, typename T2>
void etsi_its_cam_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 cam_ts_access.h.

Variable Documentation

◆ LEAP_SECOND_INSERTIONS_SINCE_2004

const std::map< uint64_t, uint16_t > etsi_its_cam_ts_msgs::access::etsi_its_msgs::LEAP_SECOND_INSERTIONS_SINCE_2004
Initial value:
{
{UNIX_SECONDS_2004, 0},
{1136073599, 1},
{1230767999, 2},
{1341100799, 3},
{1435708799, 4},
{1483228799, 5}
}

std::map that stores all leap second insertions since 2004 with the corresponding unix-date of the insertion

Definition at line 46 of file cam_ts_access.h.

◆ ONE_D_GAUSSIAN_FACTOR

const double etsi_its_cam_ts_msgs::access::etsi_its_msgs::ONE_D_GAUSSIAN_FACTOR = 2.0
constexpr

Definition at line 72 of file cam_ts_access.h.

◆ TWO_D_GAUSSIAN_FACTOR

const double etsi_its_cam_ts_msgs::access::etsi_its_msgs::TWO_D_GAUSSIAN_FACTOR = 2.4477
constexpr

Definition at line 76 of file cam_ts_access.h.

◆ UNIX_SECONDS_2004

const uint64_t etsi_its_cam_ts_msgs::access::etsi_its_msgs::UNIX_SECONDS_2004 = 1072915200

Definition at line 40 of file cam_ts_access.h.