1 | #ifndef __XMLIO_CObjectTemplate_impl__ |
---|
2 | #define __XMLIO_CObjectTemplate_impl__ |
---|
3 | |
---|
4 | namespace xmlioserver |
---|
5 | { |
---|
6 | /// ////////////////////// Définitions ////////////////////// /// |
---|
7 | template <class T> |
---|
8 | boost::unordered_map<StdString, |
---|
9 | boost::unordered_map<StdString, |
---|
10 | boost::shared_ptr<T> > > CObjectTemplate<T>::AllMapObj; |
---|
11 | |
---|
12 | template <class T> |
---|
13 | boost::unordered_map<StdString, |
---|
14 | std::vector<boost::shared_ptr<T> > > CObjectTemplate<T>::AllVectObj; |
---|
15 | |
---|
16 | template <class T> |
---|
17 | CObjectTemplate<T>::CObjectTemplate(void) |
---|
18 | : tree::CAttributeMap() |
---|
19 | , CObject() |
---|
20 | { /* Ne rien faire de plus */ } |
---|
21 | |
---|
22 | template <class T> |
---|
23 | CObjectTemplate<T>::CObjectTemplate(const StdString & id) |
---|
24 | : tree::CAttributeMap() |
---|
25 | , CObject(id) |
---|
26 | { /* Ne rien faire de plus */ } |
---|
27 | |
---|
28 | template <class T> |
---|
29 | CObjectTemplate<T>::CObjectTemplate(const CObjectTemplate<T> & object, |
---|
30 | bool withAttrList, bool withId) |
---|
31 | : tree::CAttributeMap() |
---|
32 | , CObject() |
---|
33 | { |
---|
34 | if (object.hasId() && withId) |
---|
35 | this->setId(object.getId()); |
---|
36 | ERROR("CObjectTemplate<T> construtor 3", << "Not completly implemented yet !"); |
---|
37 | } |
---|
38 | |
---|
39 | template <class T> |
---|
40 | std::vector<boost::shared_ptr<T> > & |
---|
41 | CObjectTemplate<T>::GetAllVectobject(const StdString & contextId) |
---|
42 | { return (CObjectTemplate<T>::AllVectObj[contextId]); } |
---|
43 | |
---|
44 | template <class T> |
---|
45 | CObjectTemplate<T>::~CObjectTemplate(void) |
---|
46 | { /* Ne rien faire de plus */ } |
---|
47 | |
---|
48 | template <class T> |
---|
49 | StdString CObjectTemplate<T>::toString(void) const |
---|
50 | { |
---|
51 | StdOStringStream oss; |
---|
52 | oss << "< " << T::GetName(); |
---|
53 | if (this->hasId()) |
---|
54 | oss << " id=\"" << this->getId() << "\""; |
---|
55 | oss << " " << SuperClassMap::toString() << "/>"; |
---|
56 | return (oss.str()); |
---|
57 | } |
---|
58 | |
---|
59 | template <class T> |
---|
60 | void CObjectTemplate<T>::fromString(const StdString & str) |
---|
61 | { ERROR("CObjectTemplate<T>::fromString(str)", |
---|
62 | << "[ str = " << str << "] Not implemented yet !"); } |
---|
63 | |
---|
64 | template <class T> |
---|
65 | void CObjectTemplate<T>::parse(xml::CXMLNode & node) |
---|
66 | { |
---|
67 | xml::THashAttributes attributes = node.getAttributes(); |
---|
68 | CAttributeMap::setAttributes(attributes); |
---|
69 | } |
---|
70 | |
---|
71 | template <class T> |
---|
72 | bool CObjectTemplate<T>::hasChild(void) const |
---|
73 | { return (false); } |
---|
74 | |
---|
75 | template <class T> |
---|
76 | void CObjectTemplate<T>::solveDescInheritance(const CAttributeMap * const parent) |
---|
77 | { SuperClassMap::setAttributes(parent); } |
---|
78 | |
---|
79 | } // namespace xmlioserver |
---|
80 | |
---|
81 | #endif // __XMLIO_CObjectTemplate_impl__ |
---|