Changeset 120 for XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp
- Timestamp:
- 09/08/10 15:02:31 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/XMLIO/object_template.hpp
r115 r120 27 27 28 28 if (c.baseObject != NULL) 29 out << IncIndent << "<-- Reference resolved for the following "+ T::GetName() +" : \"" << c.baseObject->getId() << "\" -->" << DecEndl << std::endl; 29 out << IncIndent << "<-- Reference resolved for the following "+ T::GetName() + 30 " : \"" << c.baseObject->getId() << "\" -->" << DecEndl << std::endl; 30 31 31 32 if (c.hasChild()) … … 48 49 49 50 virtual void resolveDescInheritance(const AttributRegistrar* _parent = 0) { addAttributes(*_parent); } 50 virtual void resolveRefInheritance (void)51 virtual void resolveRefInheritance (void) 51 52 { 52 53 std::set<T*> sset; … … 76 77 } 77 78 78 static T &CreateObject(const string& _id) throw (XMLIOUndefinedValueException)79 static T* CreateObject(const string& _id) throw (XMLIOUndefinedValueException) 79 80 { 80 81 // Si l'identifiant est répertorié, on retourne l'élément existant. … … 88 89 } 89 90 90 static T &CreateObject(void)91 static T* CreateObject(void) 91 92 { 92 93 T* value = new T; 93 94 ObjectTemplate<T>::AllListObj[CurrContext].addObject(value); 94 return ( *value);95 return (value); 95 96 } 96 97 97 static T &GetObject(const string& _id) throw (XMLIOUndefinedValueException)98 { return ( *ObjectTemplate<T>::AllListObj[CurrContext][_id]); }98 static T* GetObject(const string& _id) throw (XMLIOUndefinedValueException) 99 { return (ObjectTemplate<T>::AllListObj[CurrContext][_id]); } 99 100 100 101 static bool HasObject(const string& _id) … … 105 106 106 107 static const StrHashMap<T>& GetCurrentListObject(void) { return (AllListObj[CurrContext]); } 107 static HashMap<string, StrHashMap<T> >& GetAllListObject(void) { return (AllListObj); }108 static Poco::HashMap<string, StrHashMap<T> >& GetAllListObject(void) { return (AllListObj); } 108 109 109 110 static void SetContext(const string& id){ ObjectTemplate<T>::CurrContext = id; } … … 134 135 if (V::HasObject(did)) 135 136 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!"); 136 instance_ptr = (V*) &V::CreateObject(did);137 instance_ptr = (V*)V::CreateObject(did); 137 138 instance_ptr->parse(_node, parseAttr); 138 139 } … … 144 145 145 146 static string CurrContext; 146 static HashMap<string, StrHashMap<T> > AllListObj;147 static Poco::HashMap<string, StrHashMap<T> > AllListObj; 147 148 148 149 };// class ObjectTemplate 149 150 150 151 template <class T> string ObjectTemplate<T>::CurrContext ; 151 template <class T> HashMap<string, StrHashMap<T> > ObjectTemplate<T>::AllListObj;152 template <class T> Poco::HashMap<string, StrHashMap<T> > ObjectTemplate<T>::AllListObj; 152 153 153 154 }// namespace XMLIOSERVER
Note: See TracChangeset
for help on using the changeset viewer.