Public Member Functions | |
RefinableObjClock () | |
~RefinableObjClock () | |
bool | operator< (const RefinableObjClock &rhs) const |
bool | operator<= (const RefinableObjClock &rhs) const |
bool | operator> (const RefinableObjClock &rhs) const |
bool | operator>= (const RefinableObjClock &rhs) const |
void | Click () |
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made). | |
void | Reset () |
Reset a Clock to 0, to force an update. | |
void | Print () const |
Print clock value. Only for debugging purposes. | |
void | PrintStatic () const |
Print current general clock value. Only for debugging purposes. | |
void | AddChild (const RefinableObjClock &) |
Add a 'child' clock. | |
void | RemoveChild (const RefinableObjClock &) |
remove a child clock. This also tells the child clock to remove the parent. | |
void | AddParent (RefinableObjClock &) const |
Add a 'parent' clock. | |
void | RemoveParent (RefinableObjClock &) const |
remove a parent clock | |
void | operator= (const RefinableObjClock &rhs) |
This will (i) set the clock to the same values as the rhs clock, but will not change the list of children and parent clocks. | |
Private Member Functions | |
bool | HasParent (const RefinableObjClock &) const |
Private Attributes | |
unsigned long | mTick0 |
unsigned long | mTick1 |
std::set< const RefinableObjClock * > | mvChild |
List of 'child' clocks, which will click this clock whenever they are clicked. | |
std::set< RefinableObjClock * > | mvParent |
List of parent clocks, which will be clicked whenever this one is. | |
Static Private Attributes | |
unsigned long | msTick0 |
unsigned long | msTick1 |
Since the clock() function is not precise enough (and is architecture-dependant), we use a custom time, which records the number of events in the program which uses the library. This is purely internal, so don't worry about it...
The clock values have nothing to do with 'time' as any normal person undertands it.
|
|
|
|
|
Add a 'child' clock. Whenever a child clock is clicked, it will also click its parent. This function takes care of adding itself to the list of parent in the children clock. |
|
Add a 'parent' clock. Whenever a clock is clicked, all parent clocks also are. |
|
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made).
|
|
|
|
|
|
|
|
This will (i) set the clock to the same values as the rhs clock, but will not change the list of children and parent clocks. This will afterwards Click() the clock to notify parents. |
|
|
|
|
|
Print clock value. Only for debugging purposes.
|
|
Print current general clock value. Only for debugging purposes.
|
|
remove a child clock. This also tells the child clock to remove the parent.
|
|
remove a parent clock
|
|
Reset a Clock to 0, to force an update.
|
|
|
|
|
|
|
|
|
|
List of 'child' clocks, which will click this clock whenever they are clicked.
|
|
List of parent clocks, which will be clicked whenever this one is. This is a mutable list since reporting to parent clocks does not change the vlaue of the clock. |