19 #ifndef _ERRORSTATE_HPP_
20 #define _ERRORSTATE_HPP_
25 #include <boost/algorithm/string.hpp>
26 #include <boost/thread/mutex.hpp>
27 #include <boost/thread/locks.hpp>
28 #include <boost/shared_ptr.hpp>
38 ErrorState(
const std::string &_id,
const std::string _description =
"") : id(_id), description(_description), count(0) {}
42 void set () { count++; }
43 void clear (
const unsigned int &amount = 1) { count = count - amount; }
46 bool isSet () {
return (count > 0); }
47 std::string
getId () {
return id; }
53 std::string description;
73 void set (
const std::string &
id,
const std::string &description =
"");
74 void clear (
const std::string &
id,
const unsigned int &amount = 1);
81 ErrorStateList (ErrorStateList
const&){
kisscpp::LogStream log(__PRETTY_FUNCTION__); };
82 ErrorStateList& operator=(ErrorStateList
const&){
kisscpp::LogStream log(__PRETTY_FUNCTION__); };
84 static ErrorStateList *singleton_instance;
87 boost::mutex errorMutex;
91 #endif // _ERRORSTATE_HPP_
std::string getDescription()
Definition: errorstate.hpp:48
Definition: errorstate.hpp:66
bool isSet()
Definition: errorstate.hpp:46
ErrorStateMapType::iterator ErrorStateMapTypeIterator
Definition: errorstate.hpp:59
std::map< std::string, SharedErrorState > ErrorStateMapType
Definition: errorstate.hpp:58
void set()
Definition: errorstate.hpp:42
ErrorState(const std::string &_id, const std::string _description="")
Definition: errorstate.hpp:38
unsigned int getSetCount()
Definition: errorstate.hpp:45
void clear_all()
Definition: errorstate.hpp:44
~ErrorState()
Definition: errorstate.hpp:40
void set(const std::string &id, const std::string &description="")
Definition: errorstate.cpp:36
std::string getId()
Definition: errorstate.hpp:47
boost::shared_ptr< ErrorList > SharedErrorList
Definition: errorstate.hpp:62
boost::shared_ptr< ErrorState > SharedErrorState
Definition: errorstate.hpp:57
Definition: errorstate.hpp:35
Definition: logstream.hpp:145
void clear_all(const std::string &id)
Definition: errorstate.cpp:72
void clear(const std::string &id, const unsigned int &amount=1)
Definition: errorstate.cpp:54
void clear(const unsigned int &amount=1)
Definition: errorstate.hpp:43
~ErrorStateList()
Definition: errorstate.hpp:71
static ErrorStateList * instance()
Definition: errorstate.cpp:26
SharedErrorList getStates()
Definition: errorstate.cpp:90
ErrorList::iterator ErrorListIterator
Definition: errorstate.hpp:63
std::vector< SharedErrorState > ErrorList
Definition: errorstate.hpp:61