Rogue Wave Views Foundation Package API Reference Guide |
Rogue Wave Views Documentation Home |
Linear time converter class. More...
#include <ilviews/graphics/timeconverter.h>
Public Member Functions | |
IlvLinearTimeConverter (IlDate refTime, IlvDuration unit) | |
Constructor. More... | |
IlvLinearTimeConverter () | |
Constructor. More... | |
IlvLinearTimeConverter (const IlvLinearTimeConverter &) | |
Copy Constructor. | |
virtual IlDate | getTime (IlDouble units) |
Converts a double value to a IlDate . More... | |
IlvDuration | getUnitDuration () |
Returns the unit duration. More... | |
virtual IlDouble | getUnits (IlDate time) |
Converts a IlDate to a double. More... | |
void | setUnitDuration (IlvDuration d) |
Sets the unit duration. More... | |
Public Member Functions inherited from IlvTimeConverter | |
IlvTimeConverter (IlDate refTime) | |
Constructor. More... | |
IlvTimeConverter (const IlvTimeConverter &) | |
Copy Constructor. | |
IlDate | getReferenceTime () |
Returns the reference time. More... | |
void | lock () |
Locks the time converter. More... | |
IlUInt | refCount () const |
Get the time converter reference count. | |
void | setReferenceTime (IlDate d) |
Sets the reference time. More... | |
virtual void | unLock () |
Unlocks the resource. More... | |
Linear time converter class.
Library: views
An IlvLinearTimeConverter
is capable of converting a IlDate
to a double
value, and a double
value to a IlDate
in a linear way.
The converter is defined by a reference time and a unit duration. The reference time represents the time where the double value is 0, and the unit duration is the duration of a double value of 1.
Here is the conversion formula:
double value = ( time value - reference time ) / unit duration
IlvLinearTimeConverter::IlvLinearTimeConverter | ( | IlDate | refTime, |
IlvDuration | unit | ||
) |
Constructor.
Creates a linear time converter.
refTime | Gives the reference time for the new converter. |
unit | Defines the unit time used for the conversion. The value provided should not be 0. |
IlvLinearTimeConverter::IlvLinearTimeConverter | ( | ) |
Constructor.
Creates an IlvLinearTimeConverter
with a reference time set to the current time, and a unit duration set to one hour.
|
virtual |
Converts a double value to a IlDate
.
units | The double value to be converted. |
Implements IlvTimeConverter.
IlvDuration IlvLinearTimeConverter::getUnitDuration | ( | ) |
Returns the unit duration.
setUnitDuration
|
virtual |
Converts a IlDate
to a double.
time | The IlDate to be converted. |
Implements IlvTimeConverter.
void IlvLinearTimeConverter::setUnitDuration | ( | IlvDuration | d | ) |
Sets the unit duration.
d | The new unit duration. The value provided should not be 0 . |
© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.