SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GLObjectValuePassConnector< T > Class Template Reference

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

GUIGlObjectmyObject
 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...
 

Detailed Description

template<typename T>
class GLObjectValuePassConnector< T >

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:

  • one passing SUMOReal-values
  • one passing time tls phase definitions
See also
GUIGlObject

Definition at line 67 of file GLObjectValuePassConnector.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
[in]oThe object to get the value from
[in]sourceThe method for obtaining the value
[in]retrieverThe object to pass the value to

Definition at line 74 of file GLObjectValuePassConnector.h.

template<typename T>
virtual GLObjectValuePassConnector< T >::~GLObjectValuePassConnector ( )
inlinevirtual

Destructor.

Definition at line 82 of file GLObjectValuePassConnector.h.

template<typename T>
GLObjectValuePassConnector< T >::GLObjectValuePassConnector ( const GLObjectValuePassConnector< T > &  )
private

Invalidated copy constructor.

Member Function Documentation

template<typename T>
static void GLObjectValuePassConnector< T >::clear ( )
inlinestatic

Deletes all instances.

Definition at line 106 of file GLObjectValuePassConnector.h.

template<typename T>
GLObjectValuePassConnector<T>& GLObjectValuePassConnector< T >::operator= ( const GLObjectValuePassConnector< T > &  )
private

Invalidated assignment operator.

template<typename T>
virtual bool GLObjectValuePassConnector< T >::passValue ( )
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.

See also
GUIGlObject::active

Definition at line 140 of file GLObjectValuePassConnector.h.

template<typename T>
static void GLObjectValuePassConnector< T >::removeObject ( GUIGlObject o)
inlinestatic

Removes all instances that pass values from the object with the given id.

Used if for example a vehicle leaves the network

Parameters
[in]oThe object which shall no longer be asked for values

Definition at line 120 of file GLObjectValuePassConnector.h.

Referenced by GUIVehicle::~GUIVehicle().

template<typename T>
static void GLObjectValuePassConnector< T >::updateAll ( )
inlinestatic

Updates all instances (passes values)

Definition at line 98 of file GLObjectValuePassConnector.h.

Referenced by GUINet::guiSimulationStep().

Field Documentation

template<typename T>
GUIGlObject& GLObjectValuePassConnector< T >::myObject
protected

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

Definition at line 148 of file GLObjectValuePassConnector.h.

template<typename T>
ValueRetriever<T>* GLObjectValuePassConnector< T >::myRetriever
protected

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