Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ComponentState.h

Go to the documentation of this file.
00001 
00042 #ifndef _AMIRE_COMPONENT_EMIT_STATE_H
00043 #define _AMIRE_COMPONENT_EMIT_STATE_H
00044 
00045 #include <amire/common/Defines.h>
00046 
00047 namespace amire {
00048   namespace component {
00055     class AMIRE_EXPORT_API ComponentState : public virtual osg::Referenced {
00056     private:
00057       std::string name;
00058 
00059     public:
00060       inline ComponentState(const std::string &pname) : name(pname) {
00061       }
00062 
00063       virtual ~ComponentState();
00064 
00068       virtual size_t hashCode() const;
00069 
00073       inline const std::string &getName() const {
00074         return name;
00075       }
00076     };
00077 
00082     class AMIRE_EXPORT_API HashCompareComponentState {
00083     public:
00084       enum {
00085         bucket_size = 4,
00086         min_buckets = 8
00087       };
00088 
00092       size_t operator()(const osg::ref_ptr<const ComponentState> &state) const {
00093         return state->hashCode();
00094       }
00095 
00099       int operator()(const osg::ref_ptr<const ComponentState> &state1, const osg::ref_ptr<const ComponentState> &state2) const {
00100         return state1.get() != state2.get();
00101       }
00102     };
00103 
00107     typedef STD_HASH_MAP(std::string, osg::ref_ptr<const ComponentState>, amire::common::HashCompareString) ComponentStateMap;
00108   }
00109 }
00110 
00111 #endif

Generated on Tue May 20 17:23:52 2003 for AMIRE-Framework by doxygen1.3