base::Timer::Callback Class Reference

Encapsulates a callback functor and defines how frequently to call it. More...

Inheritance diagram for base::Timer::Callback:

base::Shared threads::NonThreadable

List of all members.

Public Member Functions

 Callback (const bool registered, const shptr< Functor > functor, const Milliseconds millisecFreq, const Timer::eDisablement canDisable=CAN_DISABLE)
 Callback (const Callback &src)
 ~Callback ()
void CallIfTimeHasCome (const Milliseconds millisecElapsed)
bool IfRegistered (void) const
bool IfCanDisable (void) const

Private Types

enum  { NEVER_CALLED = -1 }

Private Attributes

bool mRegistered
 false if Unregister() applied
shptr< FunctormFunctor
 the callback
Milliseconds mMillisecFreq
 how often to invoke callback
Milliseconds mMillisecCalled
 last time it was called
bool mCanDisable
 false if callback must be called even if Timer is disabled

Friends

class Timer


Detailed Description

Encapsulates a callback functor and defines how frequently to call it.

Callbacks are modified with the last time they were called. Callback has a copy ctor to avoid the modifying-a-copy pitfall if STL copies them (relic from using a list).


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
NEVER_CALLED 


Constructor & Destructor Documentation

base::Timer::Callback::Callback ( const bool  registered,
const shptr< Functor functor,
const Milliseconds  millisecFreq,
const Timer::eDisablement  canDisable = CAN_DISABLE 
)

ctor/dtor.

Parameters:
registered 
functor 
millisecFreq How frequently to invoke callback.
canDisable Default is "can disable".

base::Timer::Callback::Callback ( const Callback src  ) 

base::Timer::Callback::~Callback (  ) 


Member Function Documentation

void base::Timer::Callback::CallIfTimeHasCome ( const Milliseconds  millisecElapsed  ) 

If at or past the time to call this callback, then call it.

bool base::Timer::Callback::IfRegistered ( void   )  const [inline]

bool base::Timer::Callback::IfCanDisable ( void   )  const [inline]


Friends And Related Function Documentation

friend class Timer [friend]


Member Data Documentation

false if Unregister() applied

the callback

how often to invoke callback

last time it was called

false if callback must be called even if Timer is disabled


The documentation for this class was generated from the following files:
Palomino Flight Simulator documents generated by doxygen 1.5.6 on Tue Sep 28 11:37:49 2010