Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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

 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


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.


Constructor & Destructor Documentation

ObjCryst::RefinableObjClock::RefinableObjClock  ) 
 

ObjCryst::RefinableObjClock::~RefinableObjClock  ) 
 


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::Click  ) 
 

Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made).

bool ObjCryst::RefinableObjClock::HasParent const RefinableObjClock  )  const [private]
 

bool ObjCryst::RefinableObjClock::operator< const RefinableObjClock rhs  )  const
 

bool ObjCryst::RefinableObjClock::operator<= const RefinableObjClock rhs  )  const
 

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.

bool ObjCryst::RefinableObjClock::operator> const RefinableObjClock rhs  )  const
 

bool ObjCryst::RefinableObjClock::operator>= const RefinableObjClock rhs  )  const
 

void ObjCryst::RefinableObjClock::Print  )  const
 

Print clock value. Only for debugging purposes.

void ObjCryst::RefinableObjClock::PrintStatic  )  const
 

Print current general clock value. Only for debugging purposes.

void ObjCryst::RefinableObjClock::RemoveChild const RefinableObjClock  ) 
 

remove a child clock. This also tells the child clock to remove the parent.

void ObjCryst::RefinableObjClock::RemoveParent RefinableObjClock  )  const
 

remove a parent clock

void ObjCryst::RefinableObjClock::Reset  ) 
 

Reset a Clock to 0, to force an update.


Member Data Documentation

unsigned long ObjCryst::RefinableObjClock::msTick0 [static, private]
 

unsigned long ObjCryst::RefinableObjClock::msTick1 [static, private]
 

unsigned long ObjCryst::RefinableObjClock::mTick0 [private]
 

unsigned long ObjCryst::RefinableObjClock::mTick1 [private]
 

std::set<const RefinableObjClock*> ObjCryst::RefinableObjClock::mvChild [private]
 

List of 'child' clocks, which will click this clock whenever they are clicked.

std::set<RefinableObjClock*> ObjCryst::RefinableObjClock::mvParent [mutable, private]
 

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:
Generated on Tue Nov 14 15:05:47 2006 for ObjCryst++ by doxygen 1.3.6