SUMO - Simulation of Urban MObility
|
Class passing values from a GUIGlObject to another object. More...
#include <GLObjectValuePassConnector.h>
Public Member Functions | |
GLObjectValuePassConnector (GUIGlObject &o, ValueSource< T > *source, ValueRetriever< T > *retriever) | |
Constructor. | |
virtual | ~GLObjectValuePassConnector () |
Destructor. | |
Static Public Member Functions | |
static methods for interactions | |
static void | updateAll () |
Updates all instances (passes values) | |
static void | clear () |
Deletes all instances. | |
static void | removeObject (GUIGlObject &o) |
Removes all instances that pass values from the object with the given id. | |
Protected Member Functions | |
virtual bool | passValue () |
Passes the value to the retriever. | |
Protected Attributes | |
GUIGlObject & | myObject |
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. | |
Static Protected Attributes | |
static std::vector < GLObjectValuePassConnector < T > * > | myContainer |
The container of items that shall be updated. | |
static MFXMutex | myLock |
The mutex used to avoid concurrent updates of the connectors container. |
Class passing values from a GUIGlObject to another object.
A templated instance has some static member variables. They have to be defined in a cpp file. They may be found in GUINet.cpp. Two instances are used:
Definition at line 66 of file GLObjectValuePassConnector.h.
GLObjectValuePassConnector< T >::GLObjectValuePassConnector | ( | GUIGlObject & | o, |
ValueSource< T > * | source, | ||
ValueRetriever< T > * | retriever | ||
) | [inline] |
Constructor.
[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 73 of file GLObjectValuePassConnector.h.
virtual GLObjectValuePassConnector< T >::~GLObjectValuePassConnector | ( | ) | [inline, virtual] |
Destructor.
Definition at line 82 of file GLObjectValuePassConnector.h.
static void GLObjectValuePassConnector< T >::clear | ( | ) | [inline, static] |
Deletes all instances.
Definition at line 107 of file GLObjectValuePassConnector.h.
virtual bool GLObjectValuePassConnector< T >::passValue | ( | ) | [inline, protected, 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.
Definition at line 143 of file GLObjectValuePassConnector.h.
static void GLObjectValuePassConnector< T >::removeObject | ( | GUIGlObject & | o | ) | [inline, static] |
Removes all instances that pass values from the object with the given id.
Used if for example a vehicle leaves the network
[in] | o | The object which shall no longer be asked for values |
Definition at line 122 of file GLObjectValuePassConnector.h.
static void GLObjectValuePassConnector< T >::updateAll | ( | ) | [inline, static] |
Updates all instances (passes values)
Definition at line 98 of file GLObjectValuePassConnector.h.
std::vector< GLObjectValuePassConnector< T > * > GLObjectValuePassConnector< T >::myContainer [static, protected] |
The container of items that shall be updated.
Definition at line 163 of file GLObjectValuePassConnector.h.
Referenced by GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::clear(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::GLObjectValuePassConnector(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::removeObject(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::updateAll(), and GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::~GLObjectValuePassConnector().
MFXMutex GLObjectValuePassConnector< T >::myLock [static, protected] |
The mutex used to avoid concurrent updates of the connectors container.
Definition at line 160 of file GLObjectValuePassConnector.h.
Referenced by GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::clear(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::GLObjectValuePassConnector(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::removeObject(), GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::updateAll(), and GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::~GLObjectValuePassConnector().
GUIGlObject& GLObjectValuePassConnector< T >::myObject [protected] |
The object to get the values of (the object that must be active)
Definition at line 151 of file GLObjectValuePassConnector.h.
ValueRetriever<T>* GLObjectValuePassConnector< T >::myRetriever [protected] |
The destination for values.
Definition at line 157 of file GLObjectValuePassConnector.h.
Referenced by GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::passValue().
ValueSource<T>* GLObjectValuePassConnector< T >::mySource [protected] |
The source for values.
Definition at line 154 of file GLObjectValuePassConnector.h.
Referenced by GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::passValue(), and GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::~GLObjectValuePassConnector().