Eclipse SUMO - Simulation of Urban MObility
|
A wrapper for a Command function with parameter. More...
#include <ParametrisedWrappingCommand.h>
Public Types | |
typedef SUMOTime(T::* | Operation) (SUMOTime, S) |
Type of the function to execute. (with parameter) | |
Public Member Functions | |
void | deschedule () |
Marks this Command as being descheduled. | |
bool | isDescheduled () |
whether this command has been descheduled | |
ParametrisedWrappingCommand (T *receiver, const S ¶m, Operation operation) | |
Constructor. | |
virtual SUMOTime | shiftTime (SUMOTime, SUMOTime, SUMOTime) |
Reschedule or deschedule the command when quick-loading state. | |
~ParametrisedWrappingCommand () | |
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. | |
S | myParameter |
The parameter. | |
T * | myReceiver |
The object the action is directed to. | |
A wrapper for a Command function with parameter.
Definition at line 36 of file ParametrisedWrappingCommand.h.
typedef SUMOTime(T::* ParametrisedWrappingCommand< T, S >::Operation) (SUMOTime, S) |
Type of the function to execute. (with parameter)
Definition at line 40 of file ParametrisedWrappingCommand.h.
|
inline |
Constructor.
[in] | receiver | Pointer to object of type T that will receive a call to one of its methods. |
[in] | parameter | The methods parameter (must be copy-constructable) |
[in] | operation | The objects' method that will be called on execute() |
Definition at line 51 of file ParametrisedWrappingCommand.h.
|
inline |
Destructor.
Definition at line 57 of file ParametrisedWrappingCommand.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 65 of file ParametrisedWrappingCommand.h.
References ParametrisedWrappingCommand< T, S >::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 87 of file ParametrisedWrappingCommand.h.
References ParametrisedWrappingCommand< T, S >::myAmDescheduledByParent, ParametrisedWrappingCommand< T, S >::myOperation, ParametrisedWrappingCommand< T, S >::myParameter, and ParametrisedWrappingCommand< T, S >::myReceiver.
|
inline |
whether this command has been descheduled
Definition at line 70 of file ParametrisedWrappingCommand.h.
References ParametrisedWrappingCommand< T, S >::myAmDescheduledByParent.
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 109 of file ParametrisedWrappingCommand.h.
Referenced by ParametrisedWrappingCommand< T, S >::deschedule(), ParametrisedWrappingCommand< T, S >::execute(), and ParametrisedWrappingCommand< T, S >::isDescheduled().
|
private |
The object's operation to perform.
Definition at line 106 of file ParametrisedWrappingCommand.h.
Referenced by ParametrisedWrappingCommand< T, S >::execute().
|
private |
The parameter.
Definition at line 103 of file ParametrisedWrappingCommand.h.
Referenced by ParametrisedWrappingCommand< T, S >::execute().
|
private |
The object the action is directed to.
Definition at line 100 of file ParametrisedWrappingCommand.h.
Referenced by ParametrisedWrappingCommand< T, S >::execute().
|
inherited |
Definition at line 87 of file Command.h.
Referenced by MSTransportableDevice_FCDReplay::MovePedestrians::MovePedestrians(), and MSTrafficLightLogic::SwitchCommand::SwitchCommand().