00001
00002
00003
00004
00005
00006
00007
00017 #ifndef EDG_WORKLOAD_CHECKPOINTING_STEPPER_H
00018 #define EDG_WORKLOAD_CHECKPOINTING_STEPPER_H
00019
00020 #include <vector>
00021 #include <string>
00022 #include <edg/workload/checkpointing/client/checkpointing_namespace.h>
00023
00024 CHKPT_NAMESPACE_BEGIN {
00025
00038 class StepsSet {
00039
00040 public:
00042 enum iterator_type {
00043 integer,
00044 label
00045 };
00046
00048
00049
00053 StepsSet( const std::vector<std::string>& llabel, int cstep = 0 );
00057 StepsSet( int last, int cstep = 0);
00059
00061
00062
00065 void initialize( const std::vector<std::string>& llabel, int cstep );
00069 void initialize( int last, int step );
00071
00073
00074
00077 int getNextInt( void );
00081 const std::string getNextLabel( void );
00085 int getCurrentInt( void );
00089 const std::string getCurrentLabel(void );
00091
00093
00094
00096 inline bool isInt( void ) { return ( this->ss_ittype == integer ); }
00099 inline bool isLabel( void ) { return ( this->ss_ittype == label ); }
00101
00103
00104
00105 inline void clear( void ) { this->ss_steps.clear(); }
00108 inline int getCurrentIndex( void ) { return this->ss_current; }
00111 inline int getLastIndex( void ) { return this->ss_last; }
00114 inline std::vector<std::string> getLabelList( void ) { return this->ss_steps; }
00116 inline void reset( void ) { this->ss_current = this->ss_first; }
00118
00119 private:
00120 int ss_first;
00121 int ss_last;
00122 int ss_current;
00123 iterator_type ss_ittype;
00124 std::vector<std::string> ss_steps;
00126 };
00127
00128 } CHKPT_NAMESPACE_END;
00129
00130 #endif // EDG_WORKLOAD_CHECKPOINTING_STEPPER_H
00131
00132
00133
00134