ObjCryst++  1.5CVS
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ObjCryst::RefinableObjClock Class Reference

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...

List of all members.

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 PrintParentsRecursive (const string &tab="\t", const string &indent="") const
 bla, bla
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

static unsigned long msTick0
static unsigned long msTick1

Detailed Description

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.


Member Function Documentation

void ObjCryst::RefinableObjClock::AddChild ( const RefinableObjClock )

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.

void ObjCryst::RefinableObjClock::AddParent ( RefinableObjClock ) const

Add a 'parent' clock.

Whenever a clock is clicked, all parent clocks also are.

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.


Member Data Documentation

std::set<RefinableObjClock*> ObjCryst::RefinableObjClock::mvParent
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.


The documentation for this class was generated from the following file: