Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GLObjectValuePassConnector< T > Class Template Reference

Class passing values from a GUIGlObject to another object. More...

#include <GLObjectValuePassConnector.h>

Collaboration diagram for GLObjectValuePassConnector< T >:
[legend]

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

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.

Static Protected Attributes

static std::vector< GLObjectValuePassConnector< T > * > myContainer
 The container of items that shall be updated.
static FXMutex myLock
 The mutex used to avoid concurrent updates of the connectors container.

Private Member Functions

 GLObjectValuePassConnector (const GLObjectValuePassConnector< T > &)
 Invalidated copy constructor.
GLObjectValuePassConnector< T > & operator= (const GLObjectValuePassConnector< T > &)
 Invalidated assignment operator.

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 double-values
  • one passing time tls phase definitions
See also
GUIGlObject

Definition at line 57 of file GLObjectValuePassConnector.h.

Constructor & Destructor Documentation

◆ GLObjectValuePassConnector() [1/2]

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 64 of file GLObjectValuePassConnector.h.

References myContainer, myLock, myObject, myRetriever, and mySource.

Referenced by GLObjectValuePassConnector(), operator=(), removeObject(), and updateAll().

Here is the caller graph for this function:

◆ ~GLObjectValuePassConnector()

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

Destructor.

Definition at line 72 of file GLObjectValuePassConnector.h.

References myContainer, myLock, and mySource.

◆ GLObjectValuePassConnector() [2/2]

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

Invalidated copy constructor.

References GLObjectValuePassConnector().

Member Function Documentation

◆ clear()

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

Deletes all instances.

Definition at line 98 of file GLObjectValuePassConnector.h.

References myContainer, and myLock.

◆ operator=()

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

Invalidated assignment operator.

References GLObjectValuePassConnector().

◆ passValue()

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 132 of file GLObjectValuePassConnector.h.

References myRetriever, and mySource.

◆ removeObject()

template<typename T>
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 112 of file GLObjectValuePassConnector.h.

References GUIGlObject::getGlID(), GLObjectValuePassConnector(), myContainer, and myLock.

Referenced by GUIGlObject::~GUIGlObject().

Here is the caller graph for this function:

◆ updateAll()

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

Updates all instances (passes values).

Definition at line 88 of file GLObjectValuePassConnector.h.

References GLObjectValuePassConnector(), myContainer, and myLock.

Referenced by GUINet::guiSimulationStep().

Here is the caller graph for this function:

Field Documentation

◆ myContainer

template<typename T>
std::vector< GLObjectValuePassConnector<T>* > GLObjectValuePassConnector< T >::myContainer
staticprotected

The container of items that shall be updated.

Definition at line 152 of file GLObjectValuePassConnector.h.

Referenced by clear(), GLObjectValuePassConnector(), removeObject(), updateAll(), and ~GLObjectValuePassConnector().

◆ myLock

template<typename T>
FXMutex GLObjectValuePassConnector< T >::myLock
staticprotected

The mutex used to avoid concurrent updates of the connectors container.

Definition at line 149 of file GLObjectValuePassConnector.h.

Referenced by clear(), GLObjectValuePassConnector(), removeObject(), updateAll(), and ~GLObjectValuePassConnector().

◆ myObject

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

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

Definition at line 140 of file GLObjectValuePassConnector.h.

Referenced by GLObjectValuePassConnector().

◆ myRetriever

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

The destination for values.

Definition at line 146 of file GLObjectValuePassConnector.h.

Referenced by GLObjectValuePassConnector(), and passValue().

◆ mySource

template<typename T>
ValueSource<T>* GLObjectValuePassConnector< T >::mySource
protected

The source for values.

Definition at line 143 of file GLObjectValuePassConnector.h.

Referenced by GLObjectValuePassConnector(), passValue(), and ~GLObjectValuePassConnector().


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