/* * ExitflagContainer.hpp * * Created on: 11.05.2012 * Author: heber */ #ifndef EXITFLAGCONTAINER_HPP_ #define EXITFLAGCONTAINER_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif /** This class simply contains an exit flag to be inherited by instances that * deal with (asynchronous) operations. These may be given a callback function * that sets the exitflag to ErrorFlag in case of failure, e.g * * \code * const boost::function failed = * boost::bind(&ExitflagContainer::setExitflag, boost::ref(this), ErrorFlag); * \endcode * where \a this refers to the inheriting instance. * */ class ExitflagContainer { public: ExitflagContainer() : Exitflag(OkFlag) {} enum Exitflag_t { OkFlag = 0, ErrorFlag = 255 }; /** Getter for Exitflag. * * @return Exitflag */ size_t getExitflag() const { return Exitflag; } /** Setter for Exitflag. * * @param exitflag */ void setExitflag(const Exitflag_t _Exitflag) { Exitflag = _Exitflag; } private: // exit flag of this operation, derived classes may change it enum Exitflag_t Exitflag; }; #endif /* EXITFLAGCONTAINER_HPP_ */