SeC< T > Class Template Reference

SeC class to assist with checking for events. More...

#include <Simulation/SimEventQueue.H>

List of all members.

Public Member Functions

 SeC (const rutz::shared_ptr< T > event) throw ()
 SeC (const SeC< T > &other) throw ()
virtual ~SeC ()
 Destructor.
T * operator-> () const throw ()
 Get the underlying event.
T & operator* () const throw ()
 Get the underlying event.
 operator bool () const
 Convert to bool by checking whether underlying event is valid.
bool is_valid () const
 Check whether the pointee is non-null (there is an event).
rutz::shared_ptr< T > & getPtr ()
 Get the underlying shared_ptr.
const rutz::shared_ptr< T > & getPtr () const
 Get the underlying shared_ptr, const version.

Detailed Description

template<class T>
class SeC< T >

SeC class to assist with checking for events.

This class is to allow for a simple syntax when checking for events:

assume a SimEventQueue q
  if (SeC<SimEventBreak> e = q.check<SimEventBreak>(this))
    {
a matching event was found and is in 'e'
      cerr<<"Break: "<<e->toString()<<endl;
    }
  

With this syntax, matching event 'e' will only live within the scope of the 'if' statement. Note that this is a somewhat weird syntax and other seemingly equivalent syntaxes do not work. There must be an assignment and a provision to convert to bool for this to work.

Definition at line 332 of file SimEventQueue.H.


Constructor & Destructor Documentation

template<class T >
SeC< T >::~SeC (  )  [inline, virtual]

Destructor.

Definition at line 595 of file SimEventQueue.H.


Member Function Documentation

template<class T >
const rutz::shared_ptr< T > & SeC< T >::getPtr (  )  const [inline]

Get the underlying shared_ptr, const version.

Definition at line 619 of file SimEventQueue.H.

template<class T >
rutz::shared_ptr< T > & SeC< T >::getPtr (  )  [inline]

Get the underlying shared_ptr.

Definition at line 615 of file SimEventQueue.H.

template<class T >
bool SeC< T >::is_valid (  )  const [inline]

Check whether the pointee is non-null (there is an event).

Definition at line 611 of file SimEventQueue.H.

template<class T >
SeC< T >::operator bool (  )  const [inline]

Convert to bool by checking whether underlying event is valid.

This is the key to enabling declaration of a SeC variable inside an if(...) statement.

Definition at line 607 of file SimEventQueue.H.

template<class T >
T & SeC< T >::operator* (  )  const throw () [inline]

Get the underlying event.

Definition at line 603 of file SimEventQueue.H.

template<class T >
T * SeC< T >::operator-> (  )  const throw () [inline]

Get the underlying event.

Definition at line 599 of file SimEventQueue.H.


The documentation for this class was generated from the following file:
Generated on Sun May 8 08:24:49 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3