Changeset 9727 in orxonox.OLD for branches/new_class_id/src/lib/util/loading/load_param.h
- Timestamp:
- Sep 14, 2006, 5:24:31 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/util/loading/load_param.h
r8048 r9727 25 25 26 26 #include "executor/executor.h" 27 #include " executor/executor_xml.h"27 #include "parser/tinyxml/tinyxml.h" 28 28 29 29 // Forward Declaration // 30 30 class LoadClassDescription; 31 31 class LoadParamDescription; 32 class MultiType;33 34 32 35 33 /** … … 47 45 #define LoadParam_CYCLE(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \ 48 46 CLoadParam(ROOT, PARAMETER_NAME, OBJECT, createExecutor<CLASS>(&CLASS::FUNCTION), true) 49 50 #define LoadParamXML(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \51 CLoadParam(ROOT, PARAMETER_NAME, OBJECT, new ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), false)52 53 #define LoadParamXML_CYCLE(ROOT, PARAMETER_NAME, OBJECT, CLASS, FUNCTION) \54 CLoadParam(ROOT, PARAMETER_NAME, OBJECT, new ExecutorXML<CLASS>(&CLASS::FUNCTION, ROOT, PARAMETER_NAME), true)55 56 47 57 48 /** … … 78 69 } 79 70 71 80 72 /************************** 81 73 **** REAL DECLARATIONS **** 82 74 **************************/ 83 //! abstract Base class for a Loadable parameter 84 class CLoadParam : public BaseObject 75 class LoadParamBase : public BaseObject 85 76 { 86 public: 87 CLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, Executor* executor, bool inLoadCycle = false); 88 virtual ~CLoadParam(); 77 protected: 78 LoadParamBase(const TiXmlElement* root, const std::string& paramName, BaseObject* object, bool inLoadCycle = false); 89 79 90 CLoadParam& describe(const std::string& descriptionText); 91 CLoadParam& defaultValues(const MultiType& value0 = MT_NULL, const MultiType& value1 = MT_NULL, 92 const MultiType& value2 = MT_NULL, const MultiType& value3 = MT_NULL, 93 const MultiType& value4 = MT_NULL); 94 CLoadParam& attribute(const std::string& attributeName, const Executor& executor); 80 protected: 81 void describe(const std::string& descriptionText); 82 83 protected: 84 BaseObject* object; 85 const std::string paramName; 86 bool inLoadCycle; 87 88 LoadClassDescription* classDesc; //!< The LoadClassDescription of this CLoadParameter 89 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 90 const TiXmlElement* loadElem; //!< The Element to load. 91 }; 95 92 96 93 97 private: 98 bool inLoadCycle; 99 Executor* executor; 100 BaseObject* object; 101 const std::string paramName; 94 //! abstract Base class for a Loadable parameter 95 class CLoadParam : public LoadParamBase 96 { 97 public: 98 CLoadParam(const TiXmlElement* root, const std::string& paramName, BaseObject* object, Executor<const SubString>* executor, bool inLoadCycle = false); 99 virtual ~CLoadParam(); 102 100 103 LoadClassDescription* classDesc; //!< The LoadClassDescription of this CLoadParameter 104 LoadParamDescription* paramDesc; //!< The LoadParameterDescription of this LoadParameter 105 const TiXmlElement* loadElem; //!< The Element to load. 106 const void* pointerToParam; //!< A Pointer to a Parameter. 101 CLoadParam& defaultValues(const MultiType& value0 = MT_NULL, const MultiType& value1 = MT_NULL, 102 const MultiType& value2 = MT_NULL, const MultiType& value3 = MT_NULL, 103 const MultiType& value4 = MT_NULL); 104 CLoadParam& describe(const std::string& descriptionText) { LoadParamBase::describe(descriptionText); return *this; }; 105 // CLoadParam& attribute(const std::string& attributeName, const Executor<SubString>& executor); 107 106 108 MultiType* defaultValue; 107 108 private: 109 Executor<const SubString>* executor; 109 110 }; 110 111
Note: See TracChangeset
for help on using the changeset viewer.