SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StaticCommand.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A wrapper for a Command function
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
11 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef StaticCommand_h
22 #define StaticCommand_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include "Command.h"
35 
36 
37 // ===========================================================================
38 // class definition
39 // ===========================================================================
48 template< class T >
49 class StaticCommand : public Command {
50 public:
53 
54 
55 public:
63  : myOperation(operation), myAmDescheduledByParent(false) {}
64 
65 
68 
69 
75  void deschedule() {
77  }
78 
79 
80 
83 
93  SUMOTime execute(SUMOTime currentTime) {
94  // do not execute if the command was descheduled
96  return 0;
97  }
98  // execute if stil valid
99  return (*myOperation)(currentTime);
100  }
102 
103 
104 private:
107 
110 
111 
112 };
113 
114 
115 #endif
116 
117 /****************************************************************************/
118