source: XMLIO_V2/dev/dev_rv/src/xmlio/node/file.hpp @ 174

Last change on this file since 174 was 174, checked in by hozdoba, 13 years ago
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<CFieldGroup> getVirtualFieldGroup(void) const;
50         std::vector<boost::shared_ptr<CField> > getAllFields(void) const;
51
52         std::vector<boost::shared_ptr<CField> >
53            getEnabledFields(int default_outputlevel = 5,
54                             int default_level = 1,
55                             bool default_enabled = true);
56
57         /// Mutateurs ///
58         void setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup);
59         void setVirtualFieldGroup(const StdString & newVFieldGroupId);
60
61         void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout);
62
63         /// Traitements ///
64         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
65         void solveFieldRefInheritance(void);
66         void solveEFGridRef(void);
67         void solveEFOperation(void);
68
69         /// Destructeur ///
70         virtual ~CFile(void);
71
72         /// Autres ///
73         virtual void parse(xml::CXMLNode & node);
74         virtual StdString toString(void) const;
75         
76         virtual void toBinary  (StdOStream & os) const;
77         virtual void fromBinary(StdIStream & is);
78
79         /// Accesseurs statiques ///
80         static StdString GetName(void);
81         static StdString GetDefName(void);
82         
83         static ENodeType GetType(void);
84
85      private :
86
87         /// Propriétés privées ///
88         boost::shared_ptr<CFieldGroup> vFieldGroup;
89         boost::shared_ptr<io::CDataOutput> data_out;
90         std::vector<boost::shared_ptr<CField> > enabledFields;
91
92   }; // class CFile
93
94   ///--------------------------------------------------------------
95
96   // Declare/Define CFileGroup and CFileDefinition
97   DECLARE_GROUP(CFile);
98
99   ///--------------------------------------------------------------
100
101} // namespace tree
102} // namespace xmlioserver
103
104#endif // __XMLIO_CFile__
Note: See TracBrowser for help on using the repository browser.