DUDS
Distributed Update of Data from Something
duds::time::interstellar::Hectoform Struct Reference

Holds Interstellar Time down to seconds in fields that increase by a power of 100, two decimal digits each, up to a 1e10 seconds field. More...

#include <Hectoform.hpp>

Public Member Functions

 Hectoform ()=default
 Default constructor. More...
 
template<class Rep , class Period >
 Hectoform (const std::chrono::duration< Rep, Period > &d)
 Constructs a Hectoform with the duration contained in d truncated to seconds. More...
 
template<class Clock , class Duration >
 Hectoform (const std::chrono::time_point< Clock, Duration > &t)
 Constructs a Hectoform with the time contained in t truncated to seconds. More...
 
template<class Duration >
void setDuration (const Duration &d)
 Sets the stored time to be the same as the time given truncated to seconds. More...
 
template<class Time >
void setTime (const Time &d)
 
template<class Int >
void setToSeconds (Int t)
 Sets the stored time to be the same as the time given. More...
 

Public Attributes

unsigned int e10: 25
 1e10 seconds field. More...
 
unsigned int e8: 7
 1e8 seconds field. More...
 
unsigned int h: 7
 Hectoseconds field. More...
 
unsigned int M: 7
 Megaseconds field. More...
 
unsigned int ma: 7
 Myriaseconds field. More...
 
unsigned int neg: 1
 The negative flag. More...
 
unsigned int s: 7
 Seconds field. More...
 

Detailed Description

Holds Interstellar Time down to seconds in fields that increase by a power of 100, two decimal digits each, up to a 1e10 seconds field.

The size of these fields seem to be in a better range for human use than the fields of Metricform, but there are jumps that people of Earth are not acustomed to starting with megaseconds. The field names try to use metric prefixes, but prefixes do not exist for all field sizes, and some uncommon prefixes are put to use.

Author
Jeff Jackowski

Definition at line 25 of file Hectoform.hpp.

Constructor & Destructor Documentation

◆ Hectoform() [1/3]

duds::time::interstellar::Hectoform::Hectoform ( )
default

Default constructor.

◆ Hectoform() [2/3]

template<class Rep , class Period >
duds::time::interstellar::Hectoform::Hectoform ( const std::chrono::duration< Rep, Period > &  d)
inline

Constructs a Hectoform with the duration contained in d truncated to seconds.

Template Parameters
DurationA time duration class related to std::chrono::duration.
Parameters
dThe duration.

Definition at line 78 of file Hectoform.hpp.

◆ Hectoform() [3/3]

template<class Clock , class Duration >
duds::time::interstellar::Hectoform::Hectoform ( const std::chrono::time_point< Clock, Duration > &  t)
inline

Constructs a Hectoform with the time contained in t truncated to seconds.

Template Parameters
ClockA clock class, such as FemtoClock.
Parameters
tThe time.

Definition at line 88 of file Hectoform.hpp.

Member Function Documentation

◆ setDuration()

template<class Duration >
void duds::time::interstellar::Hectoform::setDuration ( const Duration &  d)
inline

Sets the stored time to be the same as the time given truncated to seconds.

Template Parameters
DurationA time duration class related to std::chrono::duration.
Parameters
dThe duration.

Definition at line 126 of file Hectoform.hpp.

Referenced by Hectoform().

◆ setTime()

template<class Time >
void duds::time::interstellar::Hectoform::setTime ( const Time &  d)
inline

Definition at line 132 of file Hectoform.hpp.

Referenced by Hectoform().

◆ setToSeconds()

template<class Int >
void duds::time::interstellar::Hectoform::setToSeconds ( Int  t)
inline

Sets the stored time to be the same as the time given.

Template Parameters
IntAn integer type or something that acts like an integer.
Parameters
tThe time in seconds.

Definition at line 97 of file Hectoform.hpp.

Referenced by setDuration(), and setTime().

Member Data Documentation

◆ e10

unsigned int duds::time::interstellar::Hectoform::e10

1e10 seconds field.

One unit in regular old Earth time is: 316 years, 324 days, 2 hours, 39 minutes, and 28 seconds.

Definition at line 31 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), and setToSeconds().

◆ e8

unsigned int duds::time::interstellar::Hectoform::e8

1e8 seconds field.

One unit in regular old Earth time is: 3 years, 61 days, 16 hours, 19 minutes, and 4 seconds.

Definition at line 37 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), and setToSeconds().

◆ h

unsigned int duds::time::interstellar::Hectoform::h

Hectoseconds field.

One unit in regular old Earth time is: 1 minute and 40 seconds.

Definition at line 56 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), setTime(), and setToSeconds().

◆ M

unsigned int duds::time::interstellar::Hectoform::M

Megaseconds field.

One unit in regular old Earth time is: 11 days, 13 hours, 46 minutes, and 40 seconds.

Definition at line 43 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), and setToSeconds().

◆ ma

unsigned int duds::time::interstellar::Hectoform::ma

Myriaseconds field.

One unit in regular old Earth time is: 2 hours, 46 minutes, and 40 seconds.

Note
The metric prefix myria has been deprecated since 1960.

Definition at line 50 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), and setToSeconds().

◆ neg

unsigned int duds::time::interstellar::Hectoform::neg

The negative flag.

It doesn't make sense to have every number in this struct be negative for a negative time, and integers cannot be negative zero, so this flag is used instead.

Definition at line 66 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), and setToSeconds().

◆ s

unsigned int duds::time::interstellar::Hectoform::s

Seconds field.

Definition at line 60 of file Hectoform.hpp.

Referenced by duds::time::interstellar::operator<<(), and setToSeconds().


The documentation for this struct was generated from the following file: