source: XMLIO_V2/dev/dev_rv/src/xmlio/object_template.hpp @ 199

Last change on this file since 199 was 172, checked in by hozdoba, 13 years ago
File size: 2.1 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_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 toBinary  (StdOStream & os) const;
33         virtual void fromBinary(StdIStream & is);
34
35         virtual void parse(xml::CXMLNode & node);
36         
37         /// Accesseurs ///
38         tree::ENodeType getType(void) const;
39
40         /// Test ///
41         virtual bool hasChild(void) const;
42
43         /// Traitements ///
44         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
45
46         /// Accesseur statique ///
47         static std::vector<boost::shared_ptr<DerivedType> > &
48            GetAllVectobject(const StdString & contextId);
49
50         /// Destructeur ///
51         virtual ~CObjectTemplate(void);
52
53      protected :
54
55         /// Constructeurs ///
56         CObjectTemplate(void);
57         explicit CObjectTemplate(const StdString & id);
58         CObjectTemplate(const CObjectTemplate<T> & object,
59                         bool withAttrList = true, bool withId = true);
60         CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented.
61
62      private :
63
64         /// Propriétés statiques ///
65         static xios_map<StdString,
66                xios_map<StdString,
67                boost::shared_ptr<DerivedType> > > AllMapObj; 
68         static xios_map<StdString,
69                std::vector<boost::shared_ptr<DerivedType> > > AllVectObj;
70
71   }; // class CObjectTemplate
72} // namespace xmlioserver
73
74#endif // __XMLIO_CObjectTemplate__
Note: See TracBrowser for help on using the repository browser.