|
libUTL++
|
#include <Duration.h>

Public Member Functions | |
| Duration (double seconds) | |
| Constructor. More... | |
| Duration (const String &str) | |
| Constructor. More... | |
| Duration (uint_t days, uint_t hours, uint_t minutes, double seconds) | |
| Constructor. More... | |
| virtual String | toString () const |
| Return a string representation of self. More... | |
| uint_t | days () const |
| Get the number of days. More... | |
| uint_t | hours () const |
| Get the number of hours. More... | |
| uint_t | minutes () const |
| Get the number of minutes. More... | |
| double | seconds () const |
| Get the number of seconds. More... | |
| virtual Number< double > & | set (const String &str) |
| Set with a format string. More... | |
| void | set (uint_t days, uint_t hours, uint_t minutes, double seconds) |
| Set a new duration. More... | |
| void | setUnit (uint_t unit, uint_t num=1) |
| Set to a multiple of a given unit. More... | |
| Duration | operator+ (const Duration &rhs) const |
| Add the given duration to self and return the result. More... | |
| Duration | operator- (const Duration &rhs) const |
| Subtract the given duration from self and return the result. More... | |
Public Member Functions inherited from utl::Float | |
| Float (double f) | |
| Constructor. More... | |
| Float (const String &str) | |
| Constructor. More... | |
| virtual int | compare (const Object &rhs) const |
| Compare with another object. More... | |
| virtual void | serialize (Stream &stream, uint_t io, uint_t mode=ser_default) |
| Serialize to or from a stream. More... | |
| String | toString (uint_t digits) const |
| Get a string representation. More... | |
| bool | isInt () const |
| Determine whether the number is an integer (has no fractional component). More... | |
| Float | abs () const |
| Get the absolute value of self. More... | |
| Float | mod (const Float &rhs) const |
| Get the result of self modulo rhs. More... | |
Public Member Functions inherited from utl::Number< double > | |
| Number (double n) | |
| Constructor. More... | |
| String | toString (const char *fmt) const |
| Convert to string. More... | |
| double | get () const |
| Get the value. More... | |
| void | set (double n) |
| Set the value. More... | |
| operator double () const | |
| Conversion to built-in type. More... | |
| Number< double > & | operator+= (double rhs) |
| Number< double > & | operator+= (const Number< double > &rhs) |
| Number< double > & | operator-= (double rhs) |
| Number< double > & | operator-= (const Number< double > &rhs) |
| Number< double > & | operator*= (double rhs) |
| Number< double > & | operator*= (const Number< double > &rhs) |
| Number< double > & | operator/= (double rhs) |
| Number< double > & | operator/= (const Number< double > &rhs) |
| double | operator+ (double rhs) const |
| double | operator+ (const Number< double > &rhs) const |
| double | operator- (double rhs) const |
| double | operator- (const Number< double > &rhs) const |
| double | operator* (double rhs) const |
| Number< double > | operator* (const Number< double > &rhs) const |
| double | operator/ (double rhs) const |
| Number< double > | operator/ (const Number< double > &rhs) const |
| Number< double > & | operator++ () |
| double | operator++ (int) |
| Number< double > & | operator-- () |
| double | operator-- (int) |
Public Member Functions inherited from utl::Object | |
| void | clear () |
| Revert to initial state. More... | |
| virtual void | vclone (const Object &rhs) |
| Make an exact copy of another instance. More... | |
| virtual void | steal (Object &rhs) |
| "Steal" the internal representation from another instance. More... | |
| virtual void | dump (Stream &os, uint_t level=uint_t_max) const |
| Dump a human-readable representation of self to the given output stream. More... | |
| void | dumpWithClassName (Stream &os, uint_t indent=4, uint_t level=uint_t_max) const |
| Front-end for dump() that prints the object's class name. More... | |
| virtual const Object & | getKey () const |
| Get the key for this object. More... | |
| bool | hasKey () const |
| Determine whether or not the object has a key. More... | |
| virtual const Object & | getProxiedObject () const |
| Get the proxied object (= self if none). More... | |
| virtual Object & | getProxiedObject () |
| Get the proxied object (= self if none). More... | |
| virtual size_t | hash (size_t size) const |
| Get the hash code for the object. More... | |
| bool | _isA (const RunTimeClass *runTimeClass) const |
| Determine whether self's class is a descendent of the given class. More... | |
| operator String () const | |
| Conversion to String. More... | |
| size_t | allocatedSize () const |
| Get the total allocated size of this object. More... | |
| virtual size_t | innerAllocatedSize () const |
| Get the "inner" allocated size. More... | |
| virtual void | addOwnedIt (const class FwdIt *it) const |
| Notify self that it owns the given iterator. More... | |
| virtual void | removeOwnedIt (const class FwdIt *it) const |
| Notify self that the given owned iterator has been destroyed. More... | |
| bool | operator< (const Object &rhs) const |
| Less-than operator. More... | |
| bool | operator<= (const Object &rhs) const |
| Less-than-or-equal-to operator. More... | |
| bool | operator> (const Object &rhs) const |
| Greater-than operator. More... | |
| bool | operator>= (const Object &rhs) const |
| Greater-than-or-equal-to operator. More... | |
| bool | operator== (const Object &rhs) const |
| Equal-to operator. More... | |
| bool | operator!= (const Object &rhs) const |
| Unequal-to operator. More... | |
| void | serializeIn (Stream &is, uint_t mode=ser_default) |
| Serialize from an input stream. More... | |
| void | serializeOut (Stream &os, uint_t mode=ser_default) const |
| Serialize to an output stream. More... | |
| void | serializeOutBoxed (Stream &os, uint_t mode=ser_default) const |
| Serialize a boxed object to an output stream. More... | |
Static Public Member Functions | |
| static Duration | days (double numDays) |
| Get duration in number of days. More... | |
| static Duration | hours (double numHours) |
| Get duration in number of hours. More... | |
| static Duration | minutes (double numMinutes) |
| Get duration in number of minutes. More... | |
| static Duration | seconds (uint64_t numSeconds) |
| Get duration in number of seconds. More... | |
Static Public Member Functions inherited from utl::Object | |
| static Object * | serializeInNullable (Stream &is, uint_t mode=ser_default) |
| Serialize a nullptr-able object from an input stream. More... | |
| static void | serializeOutNullable (const Object *object, Stream &os, uint_t mode=ser_default) |
| Serialize a nullptr-able object to an output stream. More... | |
| static void | serializeNullable (Object *&object, Stream &stream, uint_t io, uint_t mode=ser_default) |
| Serialize a nullptr-able object to or from a stream. More... | |
| static Object * | serializeInBoxed (Stream &is, uint_t mode=ser_default) |
| Serialize a boxed object from an input stream. More... | |
| static void | serializeBoxed (Object *&object, Stream &stream, uint_t io, uint_t mode=ser_default) |
| Serialize a boxed object to or from a stream. More... | |
Static Public Attributes | |
| static const Duration | oneDay |
| Duration of one day. More... | |
| static const Duration | oneHour |
| Duration of one hour. More... | |
| static const Duration | oneHalfHour |
| Duration of half an hour. More... | |
| static const Duration | oneMinute |
| Duration of one minute. More... | |
| static const Duration | oneSecond |
| Duration of one second. More... | |
Duration of time.
String Representation Formatting
The format string takes the form:
The following are examples of valid format strings:
Definition at line 40 of file Duration.h.
|
inline |
|
inline |
Constructor.
| days | number of days |
| hours | number of hours |
| minutes | number of minutes |
| seconds | number of seconds |
Definition at line 71 of file Duration.h.
References utl::toString().
|
virtual |
Return a string representation of self.
Reimplemented from utl::Float.
|
inline |
Get the number of days.
Definition at line 80 of file Duration.h.
|
inline |
Get the number of hours.
Definition at line 87 of file Duration.h.
|
inline |
Get the number of minutes.
Definition at line 96 of file Duration.h.
|
inline |
Get the number of seconds.
Definition at line 105 of file Duration.h.
Set with a format string.
Reimplemented from utl::Float.
Set a new duration.
| days | number of days |
| hours | number of hours |
| minutes | number of minutes |
| seconds | number of seconds |
Set to a multiple of a given unit.
| unit | (see utl::tm_unit_t) |
| num | multiple of the given unit |
Add the given duration to self and return the result.
| rhs | duration to add |
Definition at line 134 of file Duration.h.
Subtract the given duration from self and return the result.
| rhs | duration to subtract |
Definition at line 144 of file Duration.h.
|
inlinestatic |
Get duration in number of days.
Definition at line 151 of file Duration.h.
|
inlinestatic |
Get duration in number of hours.
Definition at line 158 of file Duration.h.
|
inlinestatic |
Get duration in number of minutes.
Definition at line 165 of file Duration.h.
Get duration in number of seconds.
Definition at line 172 of file Duration.h.
|
static |
Duration of one day.
Definition at line 179 of file Duration.h.
|
static |
Duration of one hour.
Definition at line 181 of file Duration.h.
|
static |
Duration of half an hour.
Definition at line 183 of file Duration.h.
|
static |
Duration of one minute.
Definition at line 185 of file Duration.h.
|
static |
Duration of one second.
Definition at line 187 of file Duration.h.