00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __PION_PIONADMINRIGHTS_HEADER__
00011 #define __PION_PIONADMINRIGHTS_HEADER__
00012
00013 #include <pion/PionConfig.hpp>
00014 #include <pion/PionLogger.hpp>
00015 #include <boost/cstdint.hpp>
00016 #include <boost/thread/mutex.hpp>
00017
00018
00019 namespace pion {
00020
00021
00025 class PION_COMMON_API PionAdminRights {
00026 public:
00027
00034 PionAdminRights(bool use_log = true);
00035
00037 virtual ~PionAdminRights() { release(); }
00038
00040 void release(void);
00041
00042
00043 private:
00044
00046 static const boost::int16_t ADMIN_USER_ID;
00047
00049 static boost::mutex m_mutex;
00050
00052 PionLogger m_logger;
00053
00055 boost::unique_lock<boost::mutex> m_lock;
00056
00058 boost::int16_t m_user_id;
00059
00061 bool m_has_rights;
00062
00064 bool m_use_log;
00065 };
00066
00067
00068 }
00069
00070 #endif
00071