Changeset 108 for XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_object_template.hpp
- Timestamp:
- 06/18/10 14:33:19 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/xmlio_object_template.hpp
r107 r108 22 22 public : 23 23 24 25 24 friend ostream& operator<< (ostream& out, const T& c) 26 25 { 27 26 const AttributRegistrar &ar = c; 27 28 if (c.baseObject != NULL) 29 out << IncIndent << "<-- Reference resolved for the following "+ T::GetName() +" : \"" << c.baseObject->getId() << "\" -->" << DecEndl << std::endl; 30 28 31 if (c.hasChild()) 29 32 { … … 39 42 string getName(void) const {return (T::GetName()); } 40 43 44 virtual T* getReference(void) const { return (NULL); } 45 41 46 virtual bool hasChild(void) const { return (false); } 42 47 virtual void printChild(ostream& out) const { /* Ne rien faire de plus */ } 48 43 49 virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) { addAttributes(*_parent); } 50 virtual void resolveRefInheritance(void) 51 { 52 std::vector<T*> allRef; 53 T* refer = (T*)this; 54 // On remonte le fil des héritages par référence (Boucle infinie). 55 while((refer = refer->getReference()) != NULL) 56 allRef.insert(allRef.begin(), baseObject = refer); 57 58 // Gestion des attributs ici. 59 } 44 60 45 61 static T& CreateObject(const string _id) throw (XMLIOUndefinedValueException) … … 83 99 protected : 84 100 85 ObjectTemplate(void) : AbstractObject() 101 ObjectTemplate(void) : AbstractObject(), baseObject(NULL) 86 102 {/* Ne rien faire de plus */} 87 ObjectTemplate(const string& _id) : AbstractObject(_id) 103 ObjectTemplate(const string& _id) : AbstractObject(_id), baseObject(NULL) 88 104 {/* Ne rien faire de plus */} 89 105 … … 100 116 { 101 117 if (V::HasObject(did)) 102 WARNING("Le noeud nommé "+ did +" existe déjà pour les instances de type "+V::GetName()+", le dernier défini complétera le premier dans le context actuel!");118 WARNING("Le noeud nommé \""+ did +"\" existe déjà pour les instances de type "+V::GetName()+", le dernier défini complétera le premier dans le context actuel!"); 103 119 instance_ptr = (V*)&V::CreateObject(did); 104 120 instance_ptr->parse(_node, parseAttr); … … 108 124 109 125 private : 126 T* baseObject; 110 127 111 128 static string CurrContext;
Note: See TracChangeset
for help on using the changeset viewer.