Data structure for UTC time.
More...
#include <JDAQUTCExtended.hh>
Data structure for UTC time.
Definition at line 22 of file JDAQUTCExtended.hh.
◆ JDAQUTCExtended() [1/3]
KM3NETDAQ::JDAQUTCExtended::JDAQUTCExtended |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 34 of file JDAQUTCExtended.hh.
34 :
37 {}
uint32_t UTC_16nanosecondcycles
◆ JDAQUTCExtended() [2/3]
KM3NETDAQ::JDAQUTCExtended::JDAQUTCExtended |
( |
const uint32_t | seconds, |
|
|
const uint32_t | cycles ) |
|
inline |
Constructor.
- Parameters
-
seconds | seconds [s] |
cycles | cycles [16 ns] |
Definition at line 46 of file JDAQUTCExtended.hh.
◆ JDAQUTCExtended() [3/3]
KM3NETDAQ::JDAQUTCExtended::JDAQUTCExtended |
( |
const double | nanoseconds | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 58 of file JDAQUTCExtended.hh.
59 {
61 }
void setTimeNanoSecond(const double utc_ns)
Set time.
◆ ~JDAQUTCExtended()
virtual KM3NETDAQ::JDAQUTCExtended::~JDAQUTCExtended |
( |
| ) |
|
|
inlinevirtual |
◆ getWRStatus()
bool KM3NETDAQ::JDAQUTCExtended::getWRStatus |
( |
| ) |
const |
|
inline |
Get White Rabbit status.
- Returns
- true if okay; else false
Definition at line 76 of file JDAQUTCExtended.hh.
77 {
79 }
static uint32_t getMask()
Get mask for seconds data.
◆ getUTCseconds()
uint32_t KM3NETDAQ::JDAQUTCExtended::getUTCseconds |
( |
| ) |
const |
|
inline |
◆ getUTC16nanosecondcycles()
uint32_t KM3NETDAQ::JDAQUTCExtended::getUTC16nanosecondcycles |
( |
| ) |
const |
|
inline |
◆ getTimeNanoSecond()
double KM3NETDAQ::JDAQUTCExtended::getTimeNanoSecond |
( |
| ) |
const |
|
inline |
Get time (limited to 16 ns cycles).
- Returns
- time [ns]
Definition at line 109 of file JDAQUTCExtended.hh.
110 {
112 }
uint32_t getUTC16nanosecondcycles() const
Get minor time.
static double getTick()
Get number of nano-seconds per tick.
uint32_t getUTCseconds() const
Get major time.
◆ setTimeNanoSecond()
void KM3NETDAQ::JDAQUTCExtended::setTimeNanoSecond |
( |
const double | utc_ns | ) |
|
|
inline |
◆ addTimeNanoSecond()
void KM3NETDAQ::JDAQUTCExtended::addTimeNanoSecond |
( |
const double | t_ns | ) |
|
|
inline |
Add time.
- Parameters
-
Definition at line 132 of file JDAQUTCExtended.hh.
133 {
135 const uint32_t t_s = (uint32_t) (x_ns * 1.0e-9);
136
139 }
◆ min()
Get minimum possible value.
- Returns
- minimum possible value
Definition at line 147 of file JDAQUTCExtended.hh.
148 {
150 }
JDAQUTCExtended()
Default constructor.
◆ max()
Get maximum possible value.
- Returns
- maximum possible value
Definition at line 158 of file JDAQUTCExtended.hh.
159 {
161 std::numeric_limits<uint32_t>::max());
162 }
◆ getMask()
static uint32_t KM3NETDAQ::JDAQUTCExtended::getMask |
( |
| ) |
|
|
inlinestatic |
Get mask for seconds data.
- Returns
- mask
Definition at line 170 of file JDAQUTCExtended.hh.
171 {
172 return 0x7FFFFFFF;
173 }
◆ getTick()
static double KM3NETDAQ::JDAQUTCExtended::getTick |
( |
| ) |
|
|
inlinestatic |
Get number of nano-seconds per tick.
- Returns
- time [ns]
Definition at line 181 of file JDAQUTCExtended.hh.
182 {
183 return 16.0;
184 }
◆ getInstance()
Get arbitrary offset (e.g.
for accuracy of time differences).
- Returns
- UTC time
Definition at line 192 of file JDAQUTCExtended.hh.
193 {
195
196 return utc;
197 }
Data structure for UTC time.
◆ ClassDef()
◆ getSizeof
Definition of method to get size of data type.
This method should be specialised for each desired data type with fixed length.
- Returns
- number of bytes
◆ operator>> [1/2]
Read UTC from input.
- Parameters
-
- Returns
- reader
Definition at line 33 of file JDAQUTCExtendedIO.hh.
34 {
37
38 return in;
39 }
◆ operator<< [1/2]
Write UTC to output.
- Parameters
-
- Returns
- writer
Definition at line 49 of file JDAQUTCExtendedIO.hh.
50 {
53
54 return out;
55 }
◆ operator>> [2/2]
Read UTC time.
- Parameters
-
in | intput stream |
utc | UTC extended time |
- Returns
- intput stream
Definition at line 207 of file JDAQUTCExtended.hh.
208 {
210 in.get();
212
213 return in;
214 }
◆ operator<< [2/2]
std::ostream & operator<< |
( |
std::ostream & | out, |
|
|
const JDAQUTCExtended & | utc ) |
|
friend |
Write UTC time.
- Parameters
-
out | output stream |
utc | UTC extended time |
- Returns
- output stream
Definition at line 224 of file JDAQUTCExtended.hh.
225 {
227
228 const char c = out.fill();
229
231 out << ':';
233
234 return out;
235 }
◆ UTC_seconds
uint32_t KM3NETDAQ::JDAQUTCExtended::UTC_seconds |
|
protected |
◆ UTC_16nanosecondcycles
uint32_t KM3NETDAQ::JDAQUTCExtended::UTC_16nanosecondcycles |
|
protected |
The documentation for this class was generated from the following file: