source: XMLIO_V2/dev/dev_rv/src/object_template.hpp @ 141

Last change on this file since 141 was 141, checked in by hozdoba, 13 years ago

Mise à jour depuis un autre dépôt

File size: 2.0 KB
Line 
1#ifndef __XMLIO_CObjectTemplate__
2#define __XMLIO_CObjectTemplate__
3
4/// xmlioserver headers ///
5#include "xmlioserver_spl.hpp"
6#include "attribute_map.hpp"
7#include "node/node_enum.hpp"
8
9namespace xmlioserver
10{
11   /// ////////////////////// Déclarations ////////////////////// ///
12   template <class T>
13      class CObjectTemplate
14         : public CObject
15         , public virtual tree::CAttributeMap
16   {
17
18         /// Friend ///
19         friend class CObjectFactory;
20
21         /// Typedef ///
22         typedef tree::CAttributeMap SuperClassMap;
23         typedef CObject SuperClass;
24         typedef T DerivedType;
25
26      public :
27
28         /// Autres ///
29         virtual StdString toString(void) const;
30         virtual void fromString(const StdString & str);
31
32         virtual void parse(xml::CXMLNode & node);
33
34         /// Test ///
35         virtual bool hasChild(void) const;
36
37         /// Traitements ///
38         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
39
40         /// Accesseur statique ///
41         static std::vector<boost::shared_ptr<DerivedType> > & GetAllVectobject(const StdString & contextId);
42
43         /// Destructeur ///
44         virtual ~CObjectTemplate(void);
45
46      protected :
47
48         /// Constructeurs ///
49         CObjectTemplate(void);
50         explicit CObjectTemplate(const StdString & id);
51         CObjectTemplate(const CObjectTemplate<T> & object,
52                         bool withAttrList = true, bool withId = true);
53         CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented.
54
55      private :
56
57         /// Propriétés statiques ///
58         static boost::unordered_map<StdString,
59                boost::unordered_map<StdString,
60                boost::shared_ptr<DerivedType> > > AllMapObj;
61         static boost::unordered_map<StdString,
62                std::vector<boost::shared_ptr<DerivedType> > > AllVectObj;
63
64   }; // class CObjectTemplate
65} // namespace xmlioserver
66
67#endif // __XMLIO_CObjectTemplate__
Note: See TracBrowser for help on using the repository browser.