00001 #ifndef IGUANA_FRAMEWORK_IG_STATE_KEY_H
00002 # define IGUANA_FRAMEWORK_IG_STATE_KEY_H
00003
00004
00005
00006 # include "Iguana/Framework/interface/config.h"
00007 # include <string>
00008 # include <map>
00009
00010
00011
00012
00013
00014
00015
00016
00017 class IGUANA_FRAMEWORK_API IgStateKey
00018 {
00019 public:
00020
00021
00022
00023
00024 operator unsigned (void) const;
00025 unsigned value (void) const;
00026 std::string label (void) const;
00027
00028 static IgStateKey index (const std::string &label);
00029
00030 protected:
00031 IgStateKey (unsigned value);
00032
00033 static unsigned create (const std::string &label);
00034 static void remove (const std::string &label);
00035
00036 private:
00037 unsigned int m_value;
00038
00039 typedef std::map<std::string, unsigned> Map;
00040 static Map & keymap (void);
00041 static unsigned s_count;
00042 };
00043
00044 class IGUANA_FRAMEWORK_API IgStateKeyDef : public IgStateKey
00045 {
00046 public:
00047 IgStateKeyDef (const std::string &label);
00048 ~IgStateKeyDef (void);
00049
00050 private:
00051 std::string m_label;
00052 };
00053
00054
00055
00056
00058 inline
00059 IgStateKey::operator unsigned (void) const
00060 { return m_value; }
00061
00063 inline unsigned
00064 IgStateKey::value (void) const
00065 { return m_value; }
00066
00067 #endif // IGUANA_FRAMEWORK_IG_STATE_KEY_H