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

StructPropertyType.h

Go to the documentation of this file.
00001 
00048 #ifndef _AMIRE_PROPERTY_STRUCT_PROPERTY_TYPE_H
00049 #define _AMIRE_PROPERTY_STRUCT_PROPERTY_TYPE_H
00050 
00051 #include <amire/common/Defines.h>
00052 #include <amire/property/PropertyType.h>
00053 
00054 namespace amire {
00055   namespace property {
00056     class AMIRE_EXPORT_API PropertyTypeManager;
00057 
00061     typedef STD_HASH_MAP(std::string, std::string, amire::common::HashCompareString) StringToStringMap;
00062 
00069     class AMIRE_EXPORT_API StructPropertyType : public virtual PropertyType {
00070     private:
00071       StringToConstPropertyTypeMap fieldMap;
00072       StringToStringMap semanticHintMap;
00073       std::vector<std::string> fieldNames;
00074       osg::ref_ptr<const StructPropertyType> baseType;
00075 
00076     public:
00077       StructPropertyType(const std::string &structName, PropertyTypeManager *propertyTypeManager);
00078       StructPropertyType(const std::string &structName, const std::string &baseStructName, PropertyTypeManager *propertyTypeManager);
00079 
00080       virtual ~StructPropertyType();
00081 
00082       virtual bool isTypeOf(const osg::ref_ptr<const PropertyType> &type) const;
00083 
00088       const osg::ref_ptr<const StructPropertyType> &getBaseType() const;
00089 
00095       bool isFieldDefined(const std::string &fieldName) const;
00096 
00101       const std::vector<std::string> &getFieldNames() const;
00102 
00109       const osg::ref_ptr<const PropertyType> &getFieldType(const std::string &fieldName) const;
00110 
00117       const std::string &getSemanticHint(const std::string &fieldName) const;
00118 
00124       void addField(const std::string &fieldName, const std::string &fieldType, const std::string &semanticHint = "");
00125 
00131       void addField(const std::string &fieldName, const osg::ref_ptr<const PropertyType> &type, const std::string &semanticHint = "");
00132 
00138       void changeField(const std::string &fieldName, const std::string &fieldType, const std::string &semanticHint = "");
00139 
00145       void changeField(const std::string &fieldName, const osg::ref_ptr<const PropertyType> &type, const std::string &semanticHint = "");
00146 
00153       void removeField(const std::string &fieldName);
00154 
00158       void clearFields();
00159     };
00160 
00164     typedef STD_HASH_MAP(std::string, osg::ref_ptr<StructPropertyType>, amire::common::HashCompareString) StringToStructPropertyTypeMap;
00165 
00169     typedef STD_HASH_MAP(std::string, osg::ref_ptr<const StructPropertyType>, amire::common::HashCompareString) StringToConstStructPropertyTypeMap;
00170   }
00171 }
00172 
00173 #endif
00174 

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