1 #ifndef __ARC_JOBSTATE_H__
2 #define __ARC_JOBSTATE_H__
122 static const std::string StateTypeString[];
126 JobState& operator=(
const JobState& js) { type = js.type; state = js.state; ssf = js.ssf;
return *
this; }
128 operator bool()
const {
return type !=
UNDEFINED; }
129 operator StateType()
const {
return type; }
130 bool operator!()
const {
return type ==
UNDEFINED; }
131 bool operator==(
const StateType& st)
const {
return type == st; }
132 bool operator!=(
const StateType& st)
const {
return type != st; }
173 static StateType GetStateType(
const std::string& state);
178 typedef std::string (*SpecificStateFormater)(
const std::string&);
179 SpecificStateFormater ssf;
180 static std::string FormatSpecificState(
const std::string& state) {
return state; }
182 JobState(
const std::string& state,
JobState::StateType (*map)(
const std::string&), SpecificStateFormater ssf = FormatSpecificState)
183 : ssf(ssf), state(state), type((*map)(state)) {};
195 #endif // __ARC_JOBSTATE_H__