MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLTimeHelper Class Referenceabstract

Detailed Description

This class defines an interface which provides a concrete meaning for TSLTimeInstant objects. It also provides conversion methods between TSLTimeInstant objects and dates/time.

MapLink provides a default implementation which users can use for their own derived TSLTimers. To do so, simply call the static method TSLTimeServer::defaultTimeHelper(). On Windows platforms, this represents time in 100 ns increments from the epoch of January 1, 1601 (UTC).

Public Member Functions

virtual TSLTimeInstant getCurrentTime () const =0
 
virtual bool getDateTime (TSLTimeInstant const &time, TSLTimeUInt16 &day, TSLTimeUInt16 &month, TSLTimeUInt16 &year, TSLTimeUInt16 &hour, TSLTimeUInt16 &minutes, TSLTimeUInt16 &seconds, TSLTimeUInt16 &milliseconds, bool local=false) const =0
 
virtual TSLTimeInterval hertz (double t) const =0
 
virtual double hertz (TSLTimeInterval const &interval) const =0
 
virtual TSLTimeInterval hours (double h) const =0
 
virtual double hours (TSLTimeInterval const &interval) const =0
 
virtual TSLTimeInstant makeTime (TSLTimeUInt16 day, TSLTimeUInt16 month, TSLTimeUInt16 year, TSLTimeUInt16 hour, TSLTimeUInt16 minutes, TSLTimeUInt16 seconds, TSLTimeUInt16 milliseconds, bool local=false) const =0
 
virtual TSLTimeInterval milliseconds (double ms) const =0
 
virtual double milliseconds (TSLTimeInterval const &interval) const =0
 
virtual TSLTimeInterval minutes (double m) const =0
 
virtual double minutes (TSLTimeInterval const &interval) const =0
 
virtual TSLTimeInterval seconds (double s) const =0
 
virtual double seconds (TSLTimeInterval const &interval) const =0
 
 TSLTimeHelper ()
 
virtual ~TSLTimeHelper ()
 

Constructor & Destructor Documentation

◆ TSLTimeHelper()

TSLTimeHelper::TSLTimeHelper ( )
inline

Default constructor.

◆ ~TSLTimeHelper()

TSLTimeHelper::~TSLTimeHelper ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ getCurrentTime()

virtual TSLTimeInstant TSLTimeHelper::getCurrentTime ( ) const
pure virtual

Returns the current date/time as a TSLTimeInstant object.

◆ getDateTime()

virtual bool TSLTimeHelper::getDateTime ( TSLTimeInstant const & time,
TSLTimeUInt16 & day,
TSLTimeUInt16 & month,
TSLTimeUInt16 & year,
TSLTimeUInt16 & hour,
TSLTimeUInt16 & minutes,
TSLTimeUInt16 & seconds,
TSLTimeUInt16 & milliseconds,
bool local = false ) const
pure virtual

Returns the date/time represented by the supplied TSLTimeInstant object in terms of its components( day, year, month , etc).

Parameters
timeA (const) reference to the TSLTimeInstant object.
dayA reference to an unsigned 16-bit value representing the day of the month.
monthA reference to an unsigned 16-bit value representing the month of the year (January = 1, etc.).
yearA reference to an unsigned 16-bit value representing the year (must be greater than 1601).
hourA reference to an unsigned 16-bit value representing the hour (using a 24-hour clock).
minutesA reference to an unsigned 16-bit value representing the minute.
secondsA reference to an unsigned 16-bit value representing the number of seconds.
millisecondsA reference to an unsigned 16-bit value representing the number of milliseconds.
localIf true, then the returned time will be expressed a local time, otherwise it is GMT. Default value is false.
Returns
true if the value of the TSLTimeInstant object represents a valid date, false otherwise (in this case, the components will not be valid).

◆ hertz() [1/2]

virtual TSLTimeInterval TSLTimeHelper::hertz ( double t) const
pure virtual

Converts the given number of ticks/second to a TSLTimeInterval object.

Parameters
tThe number of ticks/second.
Returns
a TSLInterval object representing the given number of ticks/second.

◆ hertz() [2/2]

virtual double TSLTimeHelper::hertz ( TSLTimeInterval const & interval) const
pure virtual

Converts the given TSLTimeInterval object to a number of ticks/second.

Parameters
intervalThe interval object.

◆ hours() [1/2]

virtual TSLTimeInterval TSLTimeHelper::hours ( double h) const
pure virtual

Converts the given number of hours to a TSLTimeInterval object.

Parameters
hThe number of hours.
Returns
a TSLInterval object representing the given number of hours.

◆ hours() [2/2]

virtual double TSLTimeHelper::hours ( TSLTimeInterval const & interval) const
pure virtual

Converts the given TSLTimeInterval object to a number of hours.

Parameters
intervalThe interval object.

◆ makeTime()

virtual TSLTimeInstant TSLTimeHelper::makeTime ( TSLTimeUInt16 day,
TSLTimeUInt16 month,
TSLTimeUInt16 year,
TSLTimeUInt16 hour,
TSLTimeUInt16 minutes,
TSLTimeUInt16 seconds,
TSLTimeUInt16 milliseconds,
bool local = false ) const
pure virtual

Creates a TSLTimeInstant object based on the supplied date/time components( day, year, month , etc).

Parameters
dayAn unsigned 16-bit value representing the day of the week (Sunday = 0, etc.).
monthAn unsigned 16-bit value representing the month of the year (January = 1, etc.).
yearAn unsigned 16-bit value representing the year (must be greater than 1601).
hourAn unsigned 16-bit value representing the hour (using a 24-hour clock).
minutesAn unsigned 16-bit value representing the minute.
secondsAn unsigned 16-bit value representing the number of seconds.
millisecondsAn unsigned 16-bit value representing the number of milliseconds.
localIf true, then the supplied time is a local time, otherwise it is GMT. Default value is false.

◆ milliseconds() [1/2]

virtual TSLTimeInterval TSLTimeHelper::milliseconds ( double ms) const
pure virtual

Converts the given number of milliseconds to a TSLTimeInterval object.

Parameters
msThe number of milliseconds.
Returns
a TSLInterval object representing the given number of milliseconds.

◆ milliseconds() [2/2]

virtual double TSLTimeHelper::milliseconds ( TSLTimeInterval const & interval) const
pure virtual

Converts the given TSLTimeInterval object to a number of milliseconds.

Parameters
intervalThe interval object.

◆ minutes() [1/2]

virtual TSLTimeInterval TSLTimeHelper::minutes ( double m) const
pure virtual

Converts the given number of minutes to a TSLTimeInterval object.

Parameters
mThe number of minutes.
Returns
a TSLInterval object representing the given number of minutes.

◆ minutes() [2/2]

virtual double TSLTimeHelper::minutes ( TSLTimeInterval const & interval) const
pure virtual

Converts the given TSLTimeInterval object to a number of minutes.

Parameters
intervalThe interval object.

◆ seconds() [1/2]

virtual TSLTimeInterval TSLTimeHelper::seconds ( double s) const
pure virtual

Converts the given number of seconds to a TSLTimeInterval object.

Parameters
sThe number of seconds.
Returns
a TSLInterval object representing the given number of seconds.

◆ seconds() [2/2]

virtual double TSLTimeHelper::seconds ( TSLTimeInterval const & interval) const
pure virtual

Converts the given TSLTimeInterval object to a number of seconds.

Parameters
intervalThe interval object.