Eclipse SUMO - Simulation of Urban MObility
|
A wrapper for a Command function. More...
#include <StaticCommand.h>
Public Types | |
typedef SUMOTime(* | Operation) (SUMOTime) |
Type of the function to execute. | |
Public Member Functions | |
void | deschedule () |
Marks this Command as being descheduled. | |
virtual SUMOTime | shiftTime (SUMOTime, SUMOTime, SUMOTime) |
Reschedule or deschedule the command when quick-loading state. | |
StaticCommand (Operation operation) | |
Constructor. | |
~StaticCommand () | |
Destructor. | |
Derived from Command | |
SUMOTime | execute (SUMOTime currentTime) |
Executes the command. | |
Data Fields | |
int | priority = 0 |
Private Attributes | |
bool | myAmDescheduledByParent |
Whether this command was descheduled (is invalid) and shall not be executed. | |
Operation | myOperation |
The object's operation to perform. | |
A wrapper for a Command function.
Definition at line 38 of file StaticCommand.h.
typedef SUMOTime(* StaticCommand< T >::Operation) (SUMOTime) |
Type of the function to execute.
Definition at line 41 of file StaticCommand.h.
|
inline |
Constructor.
[in] | receiver | Pointer to object of type T that will receive a call to one of its methods. |
[in] | operation | The objects' method that will be called on execute() |
Definition at line 51 of file StaticCommand.h.
|
inline |
Destructor.
Definition at line 56 of file StaticCommand.h.
|
inline |
Marks this Command as being descheduled.
A simple boolean marker ("myAmDescheduledByParent") is set which prevents this command from being executed.
Definition at line 64 of file StaticCommand.h.
References StaticCommand< T >::myAmDescheduledByParent.
|
inlinevirtual |
Executes the command.
If the command is not descheduled, the stored method of the stored instance is called.
[in] | currentTime | The current simulation time |
ProcessError | Derived actions may throw this exception |
Implements Command.
Definition at line 82 of file StaticCommand.h.
References StaticCommand< T >::myAmDescheduledByParent, and StaticCommand< T >::myOperation.
Reschedule or deschedule the command when quick-loading state.
The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.
[in] | currentTime | The current simulation time |
[in] | execTime | The time at which the command would have been executed |
[in] | newTime | The simulation time at which the simulation is restarted |
Reimplemented in MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.
|
private |
Whether this command was descheduled (is invalid) and shall not be executed.
Definition at line 98 of file StaticCommand.h.
Referenced by StaticCommand< T >::deschedule(), and StaticCommand< T >::execute().
|
private |
The object's operation to perform.
Definition at line 95 of file StaticCommand.h.
Referenced by StaticCommand< T >::execute().
|
inherited |
Definition at line 87 of file Command.h.
Referenced by MSTransportableDevice_FCDReplay::MovePedestrians::MovePedestrians(), and MSTrafficLightLogic::SwitchCommand::SwitchCommand().