etsi_its_messages 1.0.0
Loading...
Searching...
No Matches
constants.h File Reference

File containing constants that are used in the context of ETIS ITS Messages. More...

#include <iostream>
#include <map>

Go to the source code of this file.

Functions

uint16_t etsi_its_msgs::getLeapSecondInsertionsSince2004 (const uint64_t unix_seconds)
 Get the leap second insertions since 2004 for given unix seconds.
 

Variables

const uint64_t etsi_its_msgs::UNIX_SECONDS_2004 = 1072915200
 
const std::map< uint64_t, uint16_t > 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
 

Detailed Description

File containing constants that are used in the context of ETIS ITS Messages.

Definition in file constants.h.

Function Documentation

◆ getLeapSecondInsertionsSince2004()

uint16_t 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 60 of file constants.h.

60 {
61 // Check if the map is empty
62 if (LEAP_SECOND_INSERTIONS_SINCE_2004.empty()) return 0;
63 auto it = LEAP_SECOND_INSERTIONS_SINCE_2004.upper_bound(
64 unix_seconds); // Find the first element greater than givenUnixSecond
65 if (it == LEAP_SECOND_INSERTIONS_SINCE_2004.begin()) return 0;
66 --it; // Move iterator to the element with a key less than or equal to givenUnixSecond
67 return it->second; // Return the corresponding value
68}
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...
Definition cam_access.h:46

Variable Documentation

◆ LEAP_SECOND_INSERTIONS_SINCE_2004

const std::map<uint64_t, uint16_t> 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 45 of file constants.h.

45 {
46 {UNIX_SECONDS_2004, 0}, // 2004-01-01T00:00:00.000Z
47 {1136073599, 1}, // 2005-12-31T23:59:59.000Z
48 {1230767999, 2}, // 2008-12-31T23:59:59.000Z
49 {1341100799, 3}, // 2012-06-30T23:59:59.000Z
50 {1435708799, 4}, // 2015-06-30T23:59:59.000Z
51 {1483228799, 5} // 2016-12-31T23:59:59.000Z
52};

◆ UNIX_SECONDS_2004

const uint64_t etsi_its_msgs::UNIX_SECONDS_2004 = 1072915200

Definition at line 39 of file constants.h.