|
| MTimer (TimerIntegerType expireInMilliseconds=0) |
| Construct the timer and set its event to the given number of milliseconds. More...
|
|
| MTimer (const MTimer &other) |
| Construct a copy of timer with the same timer event time.
|
|
virtual | ~MTimer () |
| Destroy the timer.
|
|
MTimer & | operator= (const MTimer &other) |
| Assignment operator that makes the timer moment of the timer match the other timer start.
|
|
bool | IsExpired () const |
| Whether the timer moment has happened. More...
|
|
void | ResetTimer () |
| Sets the timer event into the exact moment this call is made. More...
|
|
virtual unsigned | GetEmbeddedSizeof () const |
| Timer is an embedded object type, therefore return its size in bytes. More...
|
|
|
bool | operator== (TimerIntegerType duration) const |
|
bool | operator!= (TimerIntegerType duration) const |
|
bool | operator>= (TimerIntegerType duration) const |
|
bool | operator<= (TimerIntegerType duration) const |
|
bool | operator> (TimerIntegerType duration) const |
|
bool | operator< (TimerIntegerType duration) const |
|
|
int | GetTimer () const |
|
void | SetTimer (int) |
|
Mint64 | GetTimer64 () const |
|
void | SetTimer64 (Mint64) |
|
virtual | ~MObject () |
| Object destructor.
|
|
virtual const MClass * | GetClass () const =0 |
| Get the final class of the object. More...
|
|
bool | IsEmbeddedObject () const |
| Tell if the object is of embedded kind. More...
|
|
SHOW_INTERNAL MVariant | Call (const MStdString &name, const MVariant ¶ms) |
| Call the object service with parameters, given as variant. More...
|
|
MVariant | Call0 (const MStdString &name) |
| Call the object service with no parameters. More...
|
|
MVariant | Call1 (const MStdString &name, const MVariant &p1) |
| Call the object service with one parameter. More...
|
|
MVariant | Call2 (const MStdString &name, const MVariant &p1, const MVariant &p2) |
| Call the object service with two parameter. More...
|
|
MVariant | Call3 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3) |
| Call the object service with three parameter. More...
|
|
MVariant | Call4 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4) |
| Call the object service with four parameter. More...
|
|
MVariant | Call5 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5) |
| Call the object service with five parameter. More...
|
|
MVariant | Call6 (const MStdString &name, const MVariant &p1, const MVariant &p2, const MVariant &p3, const MVariant &p4, const MVariant &p5, const MVariant &p6) |
| Call the object service with six parameter. More...
|
|
virtual MVariant | CallV (const MStdString &name, const MVariant::VariantVector ¶ms) |
| Call the object service with parameters, given as variant vector. More...
|
|
virtual bool | IsPropertyPresent (const MStdString &name) const |
| Tell if the property with the given name exists.
|
|
virtual bool | IsServicePresent (const MStdString &name) const |
| Tell if the service with the given name exists.
|
|
virtual MVariant | GetProperty (const MStdString &name) const |
| Get the property value using name of the property. More...
|
|
virtual void | SetProperty (const MStdString &name, const MVariant &value) |
| Set the property using name of the property, and value. More...
|
|
virtual MStdStringVector | GetAllPropertyNames () const |
| Return the list of publicly available properties, persistent or not. More...
|
|
virtual MStdStringVector | GetAllPersistentPropertyNames () const |
| Return the list of persistent properties. More...
|
|
virtual void | SetPersistentPropertiesToDefault () |
| Set the persistent properties of the object to their default values. More...
|
|
virtual MVariant | GetPersistentPropertyDefaultValue (const MStdString &name) const |
| Get the default value of persistent property with the name given. More...
|
|
virtual void | SetPersistentPropertyToDefault (const MStdString &name) |
| Set the persistent property with the name given to default value. More...
|
|
virtual const char * | GetType () const |
| Get the name of the type for the object (could be the same as class name).
|
|
virtual void | SetType (const MStdString &) |
| Intentionally, it will set the name of the type for the object, but the service will not allow setting the name to anything other than the current name. More...
|
|
virtual void | Validate () |
| Validate internal structures of the object. More...
|
|
Timer with milliseconds resolution.
The timer has its timer moment, when its GetTimer call will return zero and when IsExpired will start to return true. When the class is created, and no expire moment is given, the timer expires immediately, and IsExpired starts to return true. This is still useful in case many events need to be traced by the same timer, and for such case, the property GetTimer can be used to look at the time elapsed since timer creation or reset. It is also acceptable and useful to set expire moment into the past, which is achieved by supplying negative times, as it can simplify program logic for cases when a certain event can take place already.
On Windows platform, in order to have a real 64-bit timer, one has to define _WIN32_WINNT to 0x0600 or above (Vista or later OS). When Windows XP has to be supported, 64-bit timers will roll over their 32-bit parts.
Preferred timer interface manipulates with 64-bit data types, while the 32-bit interface is kept for compatibility. The 32-bit interface should not be used for long durations, such as bigger than a week, as it overflows after about 25 days.
Timer is an embedded object, which is not necessary to destroy when it is created from Reflection interface.
int MTimer::GetTimer |
( |
| ) |
const |
|
inline |
Return the distance in milliseconds between the current time and the timer event.
Negative distance means the timer event is in the future, IsExpired will be false in such case. Positive distance, IsExpired is true, will mean the timer event has happened in the past already.
It is worth mentioning that if the timer value is got right after the timer is assigned, the return value will be close to negated assignment value (milliseconds elapsed since assignment will explain the difference). Setting the timer property moves the zero position of the time scale that is used to get the timer value back.
32-bit integer variant of the interface roles over every 25 days, and therefore, should be used with care.
- Returns
- integer value, distance between the timer event and current moment.
- See also
- ResetTimer sets the timer event into the exact time of the call.
-
IsExpired checks whether the timer event has happened already.
Mint64 MTimer::GetTimer64 |
( |
| ) |
const |
|
inline |
Return the distance in milliseconds between the current time and the timer event.
Negative distance means the timer event is in the future, IsExpired will be false in such case. Positive distance, IsExpired is true, will mean the timer event has happened in the past already.
It is worth mentioning that if the timer value is got right after the timer is assigned, the return value will be close to negated assignment value (milliseconds elapsed since assignment will explain the difference). Setting the timer property moves the zero position of the time scale that is used to get the timer value back.
32-bit integer variant of the interface roles over every 25 days, and therefore, should be used with care.
- Returns
- integer value, distance between the timer event and current moment.
- See also
- ResetTimer sets the timer event into the exact time of the call.
-
IsExpired checks whether the timer event has happened already.
void MTimer::SetTimer |
( |
int |
| ) |
|
Return the distance in milliseconds between the current time and the timer event.
Negative distance means the timer event is in the future, IsExpired will be false in such case. Positive distance, IsExpired is true, will mean the timer event has happened in the past already.
It is worth mentioning that if the timer value is got right after the timer is assigned, the return value will be close to negated assignment value (milliseconds elapsed since assignment will explain the difference). Setting the timer property moves the zero position of the time scale that is used to get the timer value back.
32-bit integer variant of the interface roles over every 25 days, and therefore, should be used with care.
- Returns
- integer value, distance between the timer event and current moment.
- See also
- ResetTimer sets the timer event into the exact time of the call.
-
IsExpired checks whether the timer event has happened already.
void MTimer::SetTimer64 |
( |
Mint64 |
| ) |
|
Return the distance in milliseconds between the current time and the timer event.
Negative distance means the timer event is in the future, IsExpired will be false in such case. Positive distance, IsExpired is true, will mean the timer event has happened in the past already.
It is worth mentioning that if the timer value is got right after the timer is assigned, the return value will be close to negated assignment value (milliseconds elapsed since assignment will explain the difference). Setting the timer property moves the zero position of the time scale that is used to get the timer value back.
32-bit integer variant of the interface roles over every 25 days, and therefore, should be used with care.
- Returns
- integer value, distance between the timer event and current moment.
- See also
- ResetTimer sets the timer event into the exact time of the call.
-
IsExpired checks whether the timer event has happened already.