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

Property.h

Go to the documentation of this file.
00001 
00045 #ifndef _AMIRE_PROPERTY_PROPERTY_H
00046 #define _AMIRE_PROPERTY_PROPERTY_H
00047 
00048 #include <amire/common/Defines.h>
00049 #include <amire/property/PropertyType.h>
00050 
00051 namespace amire {
00052   namespace property {
00053     class AMIRE_EXPORT_API PropertyType;
00054     class AMIRE_EXPORT_API PropertyTypeManager;
00055 
00062     class AMIRE_EXPORT_API Property : public virtual osg::Referenced {
00063     protected:
00064       const PropertyTypeManager *propertyTypeManager;
00065       osg::ref_ptr<const PropertyType> propertyType;
00066 
00067     public:
00068       Property(const PropertyTypeManager *propertyTypeManager, const osg::ref_ptr<const PropertyType> &propertyType);
00069       virtual ~Property();
00070 
00077       virtual bool equals(const osg::ref_ptr<const Property> &property) const = 0;
00078 
00083       virtual osg::ref_ptr<Property> clone() const = 0;
00084 
00090       virtual void cloneFrom(const osg::ref_ptr<const Property> &property) = 0;
00091 
00098       virtual void fromPersistentProperty(const osg::ref_ptr<const Property> &property) = 0;
00099 
00104       virtual osg::ref_ptr<Property> toPersistentProperty() = 0;
00105 
00114       const osg::ref_ptr<const PropertyType> &getPropertyType() const;
00115 
00116     protected:
00117       static void initValue(bool &value);
00118       static void initValue(char &value);
00119       static void initValue(int &value);
00120       static void initValue(float &value);
00121       static void initValue(double &value);
00122       static void initValue(std::string &value);
00123 
00124       static bool equalsValue(bool value1, bool value2);
00125       static bool equalsValue(char value1, char value2);
00126       static bool equalsValue(int value1, int value2);
00127       static bool equalsValue(float value1, float value2);
00128       static bool equalsValue(double value1, double value2);
00129       static bool equalsValue(const std::string &value1, const std::string &value2);
00130     };
00131 
00135     typedef STD_HASH_MAP(std::string, osg::ref_ptr<Property>, amire::common::HashCompareString) StringToPropertyMap;
00136 
00140     typedef STD_HASH_MAP(std::string, osg::ref_ptr<const Property>, amire::common::HashCompareString) StringToConstPropertyMap;
00141   }
00142 }
00143 
00144 #endif
00145 

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