#include <UniEvent/Timer.h>
Inheritance diagram for strmod::unievent::Timer:

Public Types | |
| typedef ::time_t | time_t |
| The system time type. | |
Public Methods | |
| Timer () | |
| Construct a Timer. | |
| virtual | ~Timer () |
| Destroy a Timer. All events and the times they were supposed to happen are forgotten. | |
| virtual int | AreYouA (const lcore::ClassIdent &cid) const |
| Asks if a class is of a particular type, or publicly derived from that type. | |
| virtual void | postAt (const absolute_t &t, const EventPtr &ev)=0 |
| Post an event at a particular time. | |
| virtual void | postIn (const interval_t &off, const EventPtr &ev) |
| Post an event after a certain amount of time has expired. | |
| virtual absolute_t | currentTime () const=0 |
| What time is it now?! | |
Static Public Attributes | |
| const UNEVT_ClassIdent | identifier |
| Globally unique identifier for this class. | |
Protected Methods | |
| virtual const lcore::ClassIdent * | i_GetIdent () const |
| Returns the class identifier for the class the object actually is. | |
The ANSI C standard defines a rather anemic set of types for dealing with time. Worse, the exact values in most of the types are OS specific. You cannot count on time_t representing a value in the unit of seconds, for example.
Since this is supposed to a generic, OS agnostic interface, this leaves us in something of a quandry. The ANSI things _do_ tend to be focused on calendar time though, so using our own interval type is perfectly reasonable.
Given an interval type, it's reasonable to use the interval as an offset from a time_t without encoding any knowledge of what a time_t actually represents into the interface.
It's tempting to use the rather well defined struct tm type until you examine it closely and realize that it contains no provision for representing the timezone. Since it actually contains time information that would be different in different timezones, this is a fatal lack. A time_t is sufficiently ambiguous that the questions of whether or not it is UTC or a local time zone, and whether or not this can even be determined in the environment are not important to the interface.
Definition at line 67 of file Timer.h.
|
|
Asks if a class is of a particular type, or publicly derived from that type. Overriden in every derived class (with a static identifier member) to compare against the identifier, then call the AreYouA methods of all the superclasses.
Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::TimerEventTracker, and strmod::unievent::UnixEventPoll. |
|
|
Returns the class identifier for the class the object actually is. Should always be overridden in any class that has a static identifier member. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::TimerEventTracker, and strmod::unievent::UnixEventPoll. |
|
|
Globally unique identifier for this class. Every class that might need to be identified should have a public static const identifier object in it. Reimplemented from strmod::lcore::Protocol. Reimplemented in strmod::unievent::TimerEventTracker, and strmod::unievent::UnixEventPoll. |
1.3-rc1