source: XMLIO_V2/dev/common/src/xmlio/node/file.hpp @ 219

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

Préparation nouvelle arborescence

File size: 3.1 KB
Line 
1#ifndef __XMLIO_CFile__
2#define __XMLIO_CFile__
3
4/// xmlioserver headers ///
5#include "xmlioserver_spl.hpp"
6#include "field.hpp"
7#include "declare_group.hpp"
8
9#include "data_output.hpp"
10
11namespace xmlioserver {
12namespace tree {
13   
14   /// ////////////////////// Déclarations ////////////////////// ///
15
16   class CFileGroup;
17   class CFileAttributes;
18   class CFile;
19
20   ///--------------------------------------------------------------
21
22   // Declare/Define CFileAttribute
23   BEGIN_DECLARE_ATTRIBUTE_MAP(CFile)
24#  include "file_attribute.conf"
25   END_DECLARE_ATTRIBUTE_MAP(CFile)
26
27   ///--------------------------------------------------------------
28
29   class CFile
30      : public CObjectTemplate<CFile>
31      , public CFileAttributes
32   {
33         /// typedef ///
34         typedef CObjectTemplate<CFile>   SuperClass;
35         typedef CFileAttributes SuperClassAttribute;
36
37      public :
38
39         typedef CFileAttributes RelAttributes;
40         typedef CFileGroup      RelGroup;
41
42         /// Constructeurs ///
43         CFile(void);
44         explicit CFile(const StdString & id);
45         CFile(const CFile & file);       // Not implemented yet.
46         CFile(const CFile * const file); // Not implemented yet.
47
48         /// Accesseurs ///
49         boost::shared_ptr<io::CDataOutput> getDataOutput(void) const;
50         boost::shared_ptr<CFieldGroup> getVirtualFieldGroup(void) const;
51         std::vector<boost::shared_ptr<CField> > getAllFields(void) const;
52
53         std::vector<boost::shared_ptr<CField> >
54            getEnabledFields(int default_outputlevel = 5,
55                             int default_level = 1,
56                             bool default_enabled = true);
57
58      public :
59
60         /// Mutateurs ///
61         void setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup);
62         void setVirtualFieldGroup(const StdString & newVFieldGroupId);
63
64         void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout);
65
66         /// Traitements ///
67         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
68         void solveFieldRefInheritance(void);
69         void solveEFGridRef(void);
70         void solveEFOperation(void);
71
72         /// Destructeur ///
73         virtual ~CFile(void);
74
75         /// Autres ///
76         virtual void parse(xml::CXMLNode & node);
77         virtual StdString toString(void) const;
78         
79         virtual void toBinary  (StdOStream & os) const;
80         virtual void fromBinary(StdIStream & is);
81
82         /// Accesseurs statiques ///
83         static StdString GetName(void);
84         static StdString GetDefName(void);
85         
86         static ENodeType GetType(void);
87
88      private :
89
90         /// Propriétés privées ///
91         boost::shared_ptr<CFieldGroup> vFieldGroup;
92         boost::shared_ptr<io::CDataOutput> data_out;
93         std::vector<boost::shared_ptr<CField> > enabledFields;
94
95   }; // class CFile
96
97   ///--------------------------------------------------------------
98
99   // Declare/Define CFileGroup and CFileDefinition
100   DECLARE_GROUP(CFile);
101
102   ///--------------------------------------------------------------
103
104} // namespace tree
105} // namespace xmlioserver
106
107#endif // __XMLIO_CFile__
Note: See TracBrowser for help on using the repository browser.