Public Member Functions | List of all members
FIX::LocalTimeOnly Class Reference

Time only represented in local time. More...

#include <FieldTypes.h>

Inheritance diagram for FIX::LocalTimeOnly:
Inheritance graph
[legend]
Collaboration diagram for FIX::LocalTimeOnly:
Collaboration graph
[legend]

Public Member Functions

 LocalTimeOnly ()
 Defaults to the current time. More...
 
 LocalTimeOnly (const DateTime &val)
 
 LocalTimeOnly (int hour, int minute, int second, int millisecond=0)
 
 LocalTimeOnly (int hour, int minute, int second, int fraction, int precision)
 
 LocalTimeOnly (time_t time, int millisecond=0)
 
 LocalTimeOnly (time_t time, int fraction, int precision)
 
 LocalTimeOnly (const tm *time, int millisecond=0)
 
 LocalTimeOnly (const tm *time, int fraction, int precision)
 
void setCurrent ()
 Set to the current time. More...
 
- Public Member Functions inherited from FIX::DateTime
 DateTime ()
 Default constructor - initializes to zero. More...
 
 DateTime (int date, int64_t time)
 Construct from a Julian day number and time in millis. More...
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int millis)
 Construct from the specified components. More...
 
 DateTime (int year, int month, int day, int hour, int minute, int second, int fraction, int precision)
 Construct from the specified components. More...
 
virtual ~DateTime ()
 
int getYear () const
 Return the year portion of the date. More...
 
int getMonth () const
 Return the month (1-12) portion of the date. More...
 
int getDay () const
 Return the day of the month portion of the date. More...
 
int getDate () const
 Another name for the day of the month. More...
 
int getJulianDate () const
 Return the internal julian date. More...
 
int getHour () const
 Return the hour portion of the time (0-23) More...
 
int getMinute () const
 Return the minute portion of the time (0-59) More...
 
int getSecond () const
 Return the second portion of the time (0-59) More...
 
int getMillisecond () const
 Return the millisecond portion of the time (0-999) More...
 
int getMicroecond () const
 Return the microsecond portion of the time. More...
 
unsigned int getNanosecond () const
 Return the nanosecond portion of the time. More...
 
int getFraction (int precision) const
 Return the fraction portion of the time. More...
 
void getYMD (int &year, int &month, int &day) const
 Load the referenced values with the year, month and day portions of the date in a single operation. More...
 
void getHMS (int &hour, int &minute, int &second, int &millis) const
 Load the referenced values with the hour, minute, second and millisecond portions of the time in a single operation. More...
 
void getHMS (int &hour, int &minute, int &second, int &fraction, int precision) const
 Load the referenced values with the hour, minute, second and fraction portions of the time in a single operation. More...
 
int getWeekDay () const
 Calculate the weekday of the date (Sunday is 1, Saturday is 7) More...
 
time_t getTimeT () const
 Convert the DateTime to a time_t. More...
 
tm getTmUtc () const
 Convert the DateTime to a struct tm which is in UTC. More...
 
void setYMD (int year, int month, int day)
 Set the date portion of the DateTime. More...
 
void setHMS (int hour, int minute, int second, int millis)
 Set the time portion of the DateTime. More...
 
void setHMS (int hour, int minute, int second, int fraction, int precision)
 Set the time portion of the DateTime. More...
 
void setHour (int hour)
 Set the hour portion of the time. More...
 
void setMinute (int min)
 Set the minute portion of the time. More...
 
void setSecond (int sec)
 Set the seconds portion of the time. More...
 
void setMillisecond (int millis)
 Set the millisecond portion of the time. More...
 
void setMicrosecond (int micros)
 Set the microsecond portion of the time. More...
 
void setNanosecond (int nanos)
 Set the nanosecond portion of the time. More...
 
void setFraction (int fraction, int precision)
 Set the fraction portion of the time. More...
 
void clearDate ()
 Clear the date portion of the DateTime. More...
 
void clearTime ()
 Clear the time portion of the DateTime. More...
 
void set (int date, int64_t time)
 Set the internal date and time members. More...
 
void set (const DateTime &other)
 Initialize from another DateTime. More...
 
void operator+= (int seconds)
 Add a number of seconds to this. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FIX::DateTime
static int convertToNanos (int fraction, int precision)
 Convert to internal nanos. More...
 
static int64_t makeHMS (int hour, int minute, int second, int nanos)
 Helper method to convert a broken down time to a number of nanoseconds since midnight. More...
 
static DateTime nowUtc ()
 Return the current wall-clock time as a utc DateTime. More...
 
static DateTime nowLocal ()
 Return the current wall-clock time as a local DateTime. More...
 
static DateTime fromUtcTimeT (time_t t, int millis=0)
 Convert a time_t and optional milliseconds to a DateTime. More...
 
static DateTime fromLocalTimeT (time_t t, int millis=0)
 
static DateTime fromUtcTimeT (time_t t, int fraction, int precision)
 
static DateTime fromLocalTimeT (time_t t, int fraction, int precision)
 
static DateTime fromTm (const tm &tm, int millis=0)
 Convert a tm and optional milliseconds to a DateTime. More...
 
static DateTime fromTm (const tm &tm, int fraction, int precision)
 Convert a tm and optional milliseconds to a DateTime. More...
 
static int julianDate (int year, int month, int day)
 Helper method to calculate a Julian day number. More...
 
static void getYMD (int jday, int &year, int &month, int &day)
 Convert a Julian day number to a year, month and day. More...
 
- Public Attributes inherited from FIX::DateTime
int m_date
 
int64_t m_time
 
- Static Public Attributes inherited from FIX::DateTime
static const int64_t SECONDS_PER_DAY = 86400
 Magic numbers. More...
 
static const int64_t SECONDS_PER_HOUR = 3600
 
static const int64_t SECONDS_PER_MIN = 60
 
static const int64_t MINUTES_PER_HOUR = 60
 
static const int64_t NANOS_PER_DAY = 86400000000000
 
static const int64_t NANOS_PER_HOUR = 3600000000000
 
static const int64_t NANOS_PER_MIN = 60000000000
 
static const int64_t NANOS_PER_SEC = 1000000000
 
static const int64_t JULIAN_19700101 = 2440588
 

Detailed Description

Time only represented in local time.

Definition at line 759 of file FieldTypes.h.

Constructor & Destructor Documentation

◆ LocalTimeOnly() [1/8]

FIX::LocalTimeOnly::LocalTimeOnly ( )
inline

Defaults to the current time.

Definition at line 763 of file FieldTypes.h.

763  {
764  setHMS( hour, minute, second, fraction, precision );
765  }
766 

References FIX::DateTime::setHMS().

◆ LocalTimeOnly() [2/8]

FIX::LocalTimeOnly::LocalTimeOnly ( const DateTime val)
inline

Definition at line 768 of file FieldTypes.h.

768  : DateTime( fromLocalTimeT (time, millisecond) )
769  {
770  clearDate();
771  }
772 

References FIX::DateTime::clearDate().

◆ LocalTimeOnly() [3/8]

FIX::LocalTimeOnly::LocalTimeOnly ( int  hour,
int  minute,
int  second,
int  millisecond = 0 
)
inline

Definition at line 774 of file FieldTypes.h.

774  : DateTime( fromLocalTimeT (time, fraction, precision) )
775  {
776  clearDate();
777  }

References FIX::DateTime::clearDate().

◆ LocalTimeOnly() [4/8]

FIX::LocalTimeOnly::LocalTimeOnly ( int  hour,
int  minute,
int  second,
int  fraction,
int  precision 
)
inline

Definition at line 779 of file FieldTypes.h.

780  : DateTime( fromTm (*time, millisecond) )
781  {
782  clearDate();

References FIX::DateTime::clearDate().

◆ LocalTimeOnly() [5/8]

FIX::LocalTimeOnly::LocalTimeOnly ( time_t  time,
int  millisecond = 0 
)
inlineexplicit

Definition at line 784 of file FieldTypes.h.

786  : DateTime( fromTm (*time, fraction, precision) )
787  {
788  clearDate();

References FIX::DateTime::clearDate().

◆ LocalTimeOnly() [6/8]

FIX::LocalTimeOnly::LocalTimeOnly ( time_t  time,
int  fraction,
int  precision 
)
inline

Definition at line 790 of file FieldTypes.h.

793  {
794  DateTime d = nowLocal();

References FIX::DateTime::m_time, and FIX::DateTime::nowLocal().

◆ LocalTimeOnly() [7/8]

FIX::LocalTimeOnly::LocalTimeOnly ( const tm *  time,
int  millisecond = 0 
)
inline

Definition at line 796 of file FieldTypes.h.

800  : public DateTime

◆ LocalTimeOnly() [8/8]

FIX::LocalTimeOnly::LocalTimeOnly ( const tm *  time,
int  fraction,
int  precision 
)
inline

Definition at line 802 of file FieldTypes.h.

802  :
804  UtcDate()
805  {
806  setCurrent();

References FIX::UtcDate::setCurrent().

Member Function Documentation

◆ setCurrent()

void FIX::LocalTimeOnly::setCurrent ( )
inline

Set to the current time.

Definition at line 809 of file FieldTypes.h.

810  : DateTime( val )
811  {
812  clearTime();
813  }

References FIX::DateTime::clearTime().

Referenced by FIX::UtcTimeOnly::UtcTimeOnly().


The documentation for this class was generated from the following file:
FIX::LocalTimeOnly::setCurrent
void setCurrent()
Set to the current time.
Definition: FieldTypes.h:809
FIX::DateTime::clearTime
void clearTime()
Clear the time portion of the DateTime.
Definition: FieldTypes.h:381
FIX::DateTime::nowLocal
static DateTime nowLocal()
Return the current wall-clock time as a local DateTime.
Definition: FieldTypes.cpp:66
FIX::TYPE::UtcDate
@ UtcDate
Definition: FieldTypes.h:948
FIX::DateTime::setHMS
void setHMS(int hour, int minute, int second, int millis)
Set the time portion of the DateTime.
Definition: FieldTypes.h:305
FIX::DateTime::DateTime
DateTime()
Default constructor - initializes to zero.
Definition: FieldTypes.h:97
FIX::DateTime::fromLocalTimeT
static DateTime fromLocalTimeT(time_t t, int millis=0)
Definition: FieldTypes.h:491
FIX::DateTime::clearDate
void clearDate()
Clear the date portion of the DateTime.
Definition: FieldTypes.h:375
FIX::DateTime::fromTm
static DateTime fromTm(const tm &tm, int millis=0)
Convert a tm and optional milliseconds to a DateTime.
Definition: FieldTypes.h:511

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2001