FOX/ObjCryst++
1.10.X (development)
|
We need to record exactly when refinable objects have been modified for the last time (to avoid re-computation), and to do that we need a precise time. More...
Public Member Functions | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
Static Private Attributes | |
static unsigned long | msTick0 =0 |
static unsigned long | msTick1 =0 |
We need to record exactly when refinable objects have been modified for the last time (to avoid re-computation), and to do that we need a precise time.
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.
Definition at line 138 of file RefinableObj.h.
void ObjCryst::RefinableObjClock::AddChild | ( | const RefinableObjClock & | clock | ) |
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.
Definition at line 156 of file RefinableObj.cpp.
void ObjCryst::RefinableObjClock::AddParent | ( | RefinableObjClock & | clock | ) | const |
Add a 'parent' clock.
Whenever a clock is clicked, all parent clocks also are.
Definition at line 165 of file RefinableObj.cpp.
void ObjCryst::RefinableObjClock::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.
This will afterwards Click() the clock to notify parents.
Definition at line 181 of file RefinableObj.cpp.
|
mutableprivate |
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.
Definition at line 179 of file RefinableObj.h.