00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __DISCRETEEVENTSTEPPER_HPP
00033 #define __DISCRETEEVENTSTEPPER_HPP
00034
00035 #include "libecs.hpp"
00036 #include "Stepper.hpp"
00037 #include "Process.hpp"
00038
00039 #include "EventScheduler.hpp"
00040 #include "ProcessEvent.hpp"
00041
00042
00043 namespace libecs
00044 {
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 LIBECS_DM_CLASS( DiscreteEventStepper, Stepper )
00057 {
00058
00059 protected:
00060
00061 typedef EventScheduler<ProcessEvent> ProcessEventScheduler;
00062 typedef ProcessEventScheduler::EventIndex EventIndex;
00063
00064
00065
00066 public:
00067
00068 LIBECS_DM_OBJECT( DiscreteEventStepper, Stepper )
00069 {
00070 INHERIT_PROPERTIES( Stepper );
00071
00072 PROPERTYSLOT_SET_GET( Real, Tolerance );
00073 PROPERTYSLOT_GET_NO_LOAD_SAVE( Real, TimeScale );
00074 PROPERTYSLOT_GET_NO_LOAD_SAVE( String, LastProcess );
00075 }
00076
00077 DiscreteEventStepper();
00078 virtual ~DiscreteEventStepper() {}
00079
00080 virtual void initialize();
00081 virtual void step();
00082 virtual void interrupt( TimeParam aTime );
00083 virtual void log();
00084
00085
00086 SET_METHOD( Real, Tolerance )
00087 {
00088 theTolerance = value;
00089 }
00090
00091 GET_METHOD( Real, Tolerance )
00092 {
00093 return theTolerance;
00094 }
00095
00096 virtual GET_METHOD( Real, TimeScale )
00097 {
00098
00099 return 0.0;
00100 }
00101
00102 GET_METHOD( String, LastProcess );
00103
00104 ProcessVectorCref getProcessVector() const
00105 {
00106 return theProcessVector;
00107 }
00108
00109 protected:
00110
00111 ProcessEventScheduler theScheduler;
00112
00113
00114
00115 Real theTolerance;
00116
00117 EventIndex theLastEventIndex;
00118
00119
00120
00121 };
00122
00123 }
00124
00125 #endif
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135