metaproperty.h

Go to the documentation of this file.
00001 
00034 #ifndef LL_METAPROPERTY_H
00035 #define LL_METAPROPERTY_H
00036 
00037 #include "stdtypes.h"
00038 #include "llsd.h"
00039 #include "reflective.h"
00040 
00041 class LLMetaClass;
00042 class LLReflective;
00043 class LLMetaProperty
00044 {
00045 public:
00046         LLMetaProperty(const std::string& name, const LLMetaClass& object_class);
00047   virtual ~LLMetaProperty();
00048   
00049   // Get property name.
00050   const std::string& getName() const {return mName;}
00051 
00052   // Get value of this property.
00053   virtual const LLReflective* get(const LLReflective* object) const = 0;
00054   
00055   // Set value of this property.
00056   // virtual void set(LLReflective* object, const LLReflective* value) = 0;
00057   
00058   // Get value of this property as LLSD. Default returns undefined LLSD.
00059   virtual LLSD getLLSD(const LLReflective* object) const = 0;
00060   
00061   // Get the MetaClass of legal values of this property.
00062   // const LLMetaClass& getValueMetaClass();
00063   
00064   // Get the meta class that this property is a member of.
00065   const LLMetaClass& getObjectMetaClass() const;
00066 
00067 protected:
00068 
00069   // Check object is instance of object class, throw exception if not.
00070   void checkObjectClass(const LLReflective* object) const;
00071 
00072 private:
00073 
00074         std::string mName;
00075         const LLMetaClass& mObjectClass;
00076 };
00077 
00078 #endif // LL_METAPROPERTY_H

Generated on Thu Jul 1 06:09:56 2010 for Second Life Viewer by  doxygen 1.4.7