00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __SO3_USER_OBJECTS_BINDING_H__
00029 #define __SO3_USER_OBJECTS_BINDING_H__
00030
00031 #include "SO3Any.h"
00032
00033 namespace SO3
00034 {
00035
00041 class _SO3_Export SUserObjectBindings
00042 {
00043 public:
00044 protected:
00045 typedef boost::unordered_map<std::string, SAny> UserObjectsMap;
00046 typedef UserObjectsMap::iterator UserObjectsMapIterator;
00047 typedef UserObjectsMap::const_iterator UserObjectsMapConstIterator;
00048
00052 class Attributes
00053 {
00054 public:
00055 SAny mKeylessAny;
00056 UserObjectsMap* mpUserObjectsMap;
00057 protected:
00058 private:
00059
00060 public:
00064 Attributes() : mpUserObjectsMap(NULL)
00065 {
00066 }
00067
00071 ~Attributes()
00072 {
00073 if (mpUserObjectsMap != NULL)
00074 SAFE_DELETE(mpUserObjectsMap);
00075 }
00076 protected:
00077 private:
00078 };
00079 private:
00080 static SAny msEmptyAny;
00081 mutable Attributes* mAttributes;
00082
00083 public:
00087 SUserObjectBindings();
00088
00092 virtual ~SUserObjectBindings();
00093
00102 void SetUserAny(const SAny& anything);
00103
00107 const SAny& GetUserAny() const;
00108
00118 void SetUserAny(const std::string& key, const SAny& anything);
00119
00126 const SAny& GetUserAny(const std::string& key) const;
00127
00132 void EraseUserAny(const std::string& key);
00133
00137 void Clear() const;
00138
00139
00140
00141
00142 static const SAny& GetEmptyUserAny()
00143 {
00144 return msEmptyAny;
00145 }
00146 protected:
00147 private:
00148 };
00149
00150 }
00151
00152 #endif