SUMO - Simulation of Urban MObility
MSTLLogicControl::SwitchInitCommand Class Reference

This event-class is used to initialise a WAUT switch at a certain time. More...

#include <MSTLLogicControl.h>

Inheritance diagram for MSTLLogicControl::SwitchInitCommand:
Command

Public Member Functions

unsigned intgetIndex ()
 Returns a reference to the index. More...
 
const std::string & getWAUTID () const
 Returns the WAUT-id. More...
 
 SwitchInitCommand (MSTLLogicControl &p, const std::string &wautid, unsigned int index)
 Constructor. More...
 
 ~SwitchInitCommand ()
 Destructor. More...
 
Derived from Command
SUMOTime execute (SUMOTime)
 Begins a WAUT switch by executing the command. More...
 

Protected Attributes

unsigned int myIndex
 The current index within the WAUT switch table. More...
 
MSTLLogicControlmyParent
 The control to call. More...
 
std::string myWAUTID
 The id of the WAUT that shall switch. More...
 

Private Member Functions

SwitchInitCommandoperator= (const SwitchInitCommand &)
 Invalidated assignment operator. More...
 
 SwitchInitCommand (const SwitchInitCommand &)
 Invalidated copy constructor. More...
 

Detailed Description

This event-class is used to initialise a WAUT switch at a certain time.

This command is reused. The index of the WAUT-switch is incremented at each call to the control.

Definition at line 381 of file MSTLLogicControl.h.

Constructor & Destructor Documentation

MSTLLogicControl::SwitchInitCommand::SwitchInitCommand ( MSTLLogicControl p,
const std::string &  wautid,
unsigned int  index 
)
inline

Constructor.

Parameters
[in]pThe logic control
[in]wautidThe id of the WAUT
[in]indexThe first position within the WAUT table

Definition at line 388 of file MSTLLogicControl.h.

MSTLLogicControl::SwitchInitCommand::~SwitchInitCommand ( )
inline

Destructor.

Definition at line 393 of file MSTLLogicControl.h.

MSTLLogicControl::SwitchInitCommand::SwitchInitCommand ( const SwitchInitCommand )
private

Invalidated copy constructor.

Member Function Documentation

SUMOTime MSTLLogicControl::SwitchInitCommand::execute ( SUMOTime  )
inlinevirtual

Begins a WAUT switch by executing the command.

The parent's "initWautSwitch" method is called supporting this command as an argument. The result of "initWautSwitch" is returned.

"initWautSwitch" may throw an ProcessError if the program to switch to is not known.

Parameters
[in]currentTimeThe current simulation time (unused)
Returns
The time after which the command shall be executed again
Exceptions
ProcessErrorIf the program to switch to does not exist
See also
MSTLLogicControl::initWautSwitch

Implements Command.

Definition at line 414 of file MSTLLogicControl.h.

References MSTLLogicControl::initWautSwitch(), and myParent.

unsigned int& MSTLLogicControl::SwitchInitCommand::getIndex ( )
inline

Returns a reference to the index.

Returns
A reference to the index

Definition at line 432 of file MSTLLogicControl.h.

References myIndex.

Referenced by MSTLLogicControl::initWautSwitch().

const std::string& MSTLLogicControl::SwitchInitCommand::getWAUTID ( ) const
inline

Returns the WAUT-id.

Returns
The WAUT id

Definition at line 424 of file MSTLLogicControl.h.

References myWAUTID.

Referenced by MSTLLogicControl::initWautSwitch().

SwitchInitCommand& MSTLLogicControl::SwitchInitCommand::operator= ( const SwitchInitCommand )
private

Invalidated assignment operator.

Field Documentation

unsigned int MSTLLogicControl::SwitchInitCommand::myIndex
protected

The current index within the WAUT switch table.

Definition at line 445 of file MSTLLogicControl.h.

Referenced by getIndex().

MSTLLogicControl& MSTLLogicControl::SwitchInitCommand::myParent
protected

The control to call.

Definition at line 439 of file MSTLLogicControl.h.

Referenced by execute().

std::string MSTLLogicControl::SwitchInitCommand::myWAUTID
protected

The id of the WAUT that shall switch.

Definition at line 442 of file MSTLLogicControl.h.

Referenced by getWAUTID().


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