GLObjectValuePassConnector< T > Class Template Reference

#include <GLObjectValuePassConnector.h>

Inheritance diagram for GLObjectValuePassConnector< T >:

MSUpdateEachTimestep< GLObjectValuePassConnector< T > >

Detailed Description

template<typename T>
class GLObjectValuePassConnector< T >

Class passing values from a gl-object to another object.

See also:
MSUpdateEachTimestep

GUIGlObject

Definition at line 54 of file GLObjectValuePassConnector.h.


Public Member Functions

 GLObjectValuePassConnector (GUIGlObject &o, ValueSource< T > *source, ValueRetriever< T > *retriever) throw ()
 Constructor.
virtual bool updateEachTimestep () throw ()
 Passes the value to the retriever.
virtual ~GLObjectValuePassConnector () throw ()
 Destructor.

Private Attributes

GUIGlObjectmyObject
 The object to get the values of (the object that must be active).
ValueRetriever< T > * myRetriever
 The destination for values.
ValueSource< T > * mySource
 The source for values.

Constructor & Destructor Documentation

template<typename T>
GLObjectValuePassConnector< T >::GLObjectValuePassConnector ( GUIGlObject o,
ValueSource< T > *  source,
ValueRetriever< T > *  retriever 
) throw () [inline]

Constructor.

Parameters:
[in] o The object to get the value from
[in] source The method for obtaining the value
[in] retriever The object to pass the value to

Definition at line 62 of file GLObjectValuePassConnector.h.

00065             : myObject(o), mySource(source), myRetriever(retriever) { }

template<typename T>
virtual GLObjectValuePassConnector< T >::~GLObjectValuePassConnector (  )  throw () [inline, virtual]

Destructor.

Definition at line 69 of file GLObjectValuePassConnector.h.

00069                                                   {
00070         delete mySource;
00071     }


Member Function Documentation

template<typename T>
virtual bool GLObjectValuePassConnector< T >::updateEachTimestep (  )  throw () [inline, virtual]

Passes the value to the retriever.

Retrieves the value from the object, in the case the object is active. Passes the value to the retriever.

See also:
GUIGlObject::active

Implements MSUpdateEachTimestep< GLObjectValuePassConnector< T > >.

Definition at line 80 of file GLObjectValuePassConnector.h.

00080                                               {
00081         if (!myObject.active()) {
00082             return false;
00083         }
00084         myRetriever->addValue(mySource->getValue());
00085         return true;
00086     }


Field Documentation

template<typename T>
GUIGlObject& GLObjectValuePassConnector< T >::myObject [private]

The object to get the values of (the object that must be active).

Definition at line 90 of file GLObjectValuePassConnector.h.

Referenced by GLObjectValuePassConnector< std::pair< int, MSPhaseDefinition > >::updateEachTimestep().

template<typename T>
ValueRetriever<T>* GLObjectValuePassConnector< T >::myRetriever [private]

template<typename T>
ValueSource<T>* GLObjectValuePassConnector< T >::mySource [private]


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

Generated on Wed May 5 00:06:41 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6