Jpp
debug
the software that should make you happy
software
DataQueue
DataFormats
utctime.hh
Go to the documentation of this file.
1
#ifndef __UTCTIME_HH
2
#define __UTCTIME_HH
3
4
#include <ostream>
5
#include <stdint.h>
6
#include <arpa/inet.h>
7
8
/**
9
* \author cpellegrino
10
*/
11
12
struct
UTCTime
13
{
14
uint32_t
Sec
;
15
uint32_t
Tics
;
16
17
uint32_t
sec
()
const
18
{
19
return
ntohl(
Sec
);
20
}
21
22
uint32_t
tics
()
const
23
{
24
return
ntohl(
Tics
);
25
}
26
27
uint64_t
inMilliSeconds
()
const
28
{
29
return
uint64_t(
sec
()) * 1000 + uint64_t(
tics
()) / 62500;
30
}
31
32
};
33
34
inline
std::ostream&
operator <<
(std::ostream& stream,
const
UTCTime
& t)
35
{
36
return
stream <<
"Seconds: "
<< t.
sec
() <<
'\n'
37
<<
"Tics: "
<< t.
tics
();
38
}
39
40
#endif
UTCTime
Definition:
utctime.hh:13
UTCTime::Sec
uint32_t Sec
Definition:
utctime.hh:14
UTCTime::sec
uint32_t sec() const
Definition:
utctime.hh:17
UTCTime::Tics
uint32_t Tics
Definition:
utctime.hh:15
UTCTime::tics
uint32_t tics() const
Definition:
utctime.hh:22
UTCTime::inMilliSeconds
uint64_t inMilliSeconds() const
Definition:
utctime.hh:27
operator<<
std::ostream & operator<<(std::ostream &stream, const UTCTime &t)
Definition:
utctime.hh:34
Generated by
1.9.1