[152] | 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 | |
---|
[168] | 11 | namespace xmlioserver { |
---|
| 12 | namespace tree { |
---|
| 13 | |
---|
| 14 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
[152] | 15 | |
---|
[168] | 16 | class CFileGroup; |
---|
| 17 | class CFileAttributes; |
---|
| 18 | class CFile; |
---|
[152] | 19 | |
---|
[168] | 20 | ///-------------------------------------------------------------- |
---|
[152] | 21 | |
---|
[168] | 22 | // Declare/Define CFileAttribute |
---|
| 23 | BEGIN_DECLARE_ATTRIBUTE_MAP(CFile) |
---|
[173] | 24 | # include "file_attribute.conf" |
---|
[168] | 25 | END_DECLARE_ATTRIBUTE_MAP(CFile) |
---|
[152] | 26 | |
---|
[168] | 27 | ///-------------------------------------------------------------- |
---|
[152] | 28 | |
---|
[168] | 29 | class CFile |
---|
| 30 | : public CObjectTemplate<CFile> |
---|
| 31 | , public CFileAttributes |
---|
| 32 | { |
---|
| 33 | /// typedef /// |
---|
| 34 | typedef CObjectTemplate<CFile> SuperClass; |
---|
| 35 | typedef CFileAttributes SuperClassAttribute; |
---|
[152] | 36 | |
---|
[168] | 37 | public : |
---|
[152] | 38 | |
---|
[168] | 39 | typedef CFileAttributes RelAttributes; |
---|
| 40 | typedef CFileGroup RelGroup; |
---|
[152] | 41 | |
---|
[168] | 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. |
---|
[152] | 47 | |
---|
[168] | 48 | /// Accesseurs /// |
---|
[214] | 49 | boost::shared_ptr<io::CDataOutput> getDataOutput(void) const; |
---|
[168] | 50 | boost::shared_ptr<CFieldGroup> getVirtualFieldGroup(void) const; |
---|
| 51 | std::vector<boost::shared_ptr<CField> > getAllFields(void) const; |
---|
[152] | 52 | |
---|
[168] | 53 | std::vector<boost::shared_ptr<CField> > |
---|
| 54 | getEnabledFields(int default_outputlevel = 5, |
---|
[257] | 55 | int default_level = 1, |
---|
| 56 | bool default_enabled = true); |
---|
[152] | 57 | |
---|
[214] | 58 | public : |
---|
| 59 | |
---|
[168] | 60 | /// Mutateurs /// |
---|
| 61 | void setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup); |
---|
| 62 | void setVirtualFieldGroup(const StdString & newVFieldGroupId); |
---|
[152] | 63 | |
---|
[168] | 64 | void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout); |
---|
[152] | 65 | |
---|
[168] | 66 | /// Traitements /// |
---|
| 67 | virtual void solveDescInheritance(const CAttributeMap * const parent = 0); |
---|
| 68 | void solveFieldRefInheritance(void); |
---|
| 69 | void solveEFGridRef(void); |
---|
| 70 | void solveEFOperation(void); |
---|
[152] | 71 | |
---|
[168] | 72 | /// Destructeur /// |
---|
| 73 | virtual ~CFile(void); |
---|
[152] | 74 | |
---|
[168] | 75 | /// Autres /// |
---|
| 76 | virtual void parse(xml::CXMLNode & node); |
---|
| 77 | virtual StdString toString(void) const; |
---|
[174] | 78 | |
---|
| 79 | virtual void toBinary (StdOStream & os) const; |
---|
| 80 | virtual void fromBinary(StdIStream & is); |
---|
[152] | 81 | |
---|
[168] | 82 | /// Accesseurs statiques /// |
---|
| 83 | static StdString GetName(void); |
---|
| 84 | static StdString GetDefName(void); |
---|
| 85 | |
---|
| 86 | static ENodeType GetType(void); |
---|
[152] | 87 | |
---|
[168] | 88 | private : |
---|
[152] | 89 | |
---|
[168] | 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; |
---|
[152] | 94 | |
---|
[168] | 95 | }; // class CFile |
---|
[152] | 96 | |
---|
[168] | 97 | ///-------------------------------------------------------------- |
---|
[152] | 98 | |
---|
[168] | 99 | // Declare/Define CFileGroup and CFileDefinition |
---|
| 100 | DECLARE_GROUP(CFile); |
---|
[152] | 101 | |
---|
[168] | 102 | ///-------------------------------------------------------------- |
---|
| 103 | |
---|
| 104 | } // namespace tree |
---|
[152] | 105 | } // namespace xmlioserver |
---|
| 106 | |
---|
| 107 | #endif // __XMLIO_CFile__ |
---|