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. More... | |
virtual | ~GLObjectValuePassConnector () |
Destructor. More... | |
Static Public Member Functions | |
static methods for interactions | |
static void | updateAll () |
Updates all instances (passes values) More... | |
static void | clear () |
Deletes all instances. More... | |
static void | removeObject (GUIGlObject &o) |
Removes all instances that pass values from the object with the given id. More... | |
Protected Member Functions | |
virtual bool | passValue () |
Passes the value to the retriever. More... | |
Protected Attributes | |
GUIGlObject & | myObject |
The object to get the values of (the object that must be active) More... | |
ValueRetriever< T > * | myRetriever |
The destination for values. More... | |
ValueSource< T > * | mySource |
The source for values. More... | |
Static Protected Attributes | |
static std::vector < GLObjectValuePassConnector < T > * > | myContainer |
The container of items that shall be updated. More... | |
static MFXMutex | myLock |
The mutex used to avoid concurrent updates of the connectors container. More... | |
Private Member Functions | |
GLObjectValuePassConnector (const GLObjectValuePassConnector< T > &) | |
Invalidated copy constructor. More... | |
GLObjectValuePassConnector< T > & | operator= (const GLObjectValuePassConnector< T > &) |
Invalidated assignment operator. More... | |
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 67 of file GLObjectValuePassConnector.h.
|
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 74 of file GLObjectValuePassConnector.h.
|
inlinevirtual |
Destructor.
Definition at line 82 of file GLObjectValuePassConnector.h.
|
private |
Invalidated copy constructor.
|
inlinestatic |
Deletes all instances.
Definition at line 106 of file GLObjectValuePassConnector.h.
|
private |
Invalidated assignment operator.
|
inlineprotectedvirtual |
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 140 of file GLObjectValuePassConnector.h.
|
inlinestatic |
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 120 of file GLObjectValuePassConnector.h.
Referenced by GUIVehicle::~GUIVehicle().
|
inlinestatic |
Updates all instances (passes values)
Definition at line 98 of file GLObjectValuePassConnector.h.
Referenced by GUINet::guiSimulationStep().
|
staticprotected |
The container of items that shall be updated.
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().
|
staticprotected |
The mutex used to avoid concurrent updates of the connectors container.
Definition at line 157 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().
|
protected |
The object to get the values of (the object that must be active)
Definition at line 148 of file GLObjectValuePassConnector.h.
|
protected |
The destination for values.
Definition at line 154 of file GLObjectValuePassConnector.h.
Referenced by GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::passValue().
|
protected |
The source for values.
Definition at line 151 of file GLObjectValuePassConnector.h.
Referenced by GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::passValue(), and GLObjectValuePassConnector< std::pair< SUMOTime, MSPhaseDefinition > >::~GLObjectValuePassConnector().