source: XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp @ 191

Last change on this file since 191 was 188, checked in by hozdoba, 13 years ago
File size: 3.5 KB
Line 
1#ifndef __XMLIO_CField__
2#define __XMLIO_CField__
3
4/// xmlioserver headers ///
5#include "xmlioserver_spl.hpp"
6#include "group_factory.hpp"
7#include "functor.hpp"
8#include "functor_type.hpp"
9#include "duration.hpp"
10#include "declare_group.hpp"
11
12namespace xmlioserver {
13namespace tree {
14   
15   /// ////////////////////// Déclarations ////////////////////// ///
16
17   class CFieldGroup;
18   class CFieldAttributes;
19   class CField;
20
21   class CFile;
22   class CGrid;
23
24   ///--------------------------------------------------------------
25
26   // Declare/Define CFieldAttribute
27   BEGIN_DECLARE_ATTRIBUTE_MAP(CField)
28#  include "field_attribute.conf"
29   END_DECLARE_ATTRIBUTE_MAP(CField)
30
31   ///--------------------------------------------------------------
32   class CField
33      : public CObjectTemplate<CField>
34      , public CFieldAttributes
35   {
36         /// friend ///
37         friend class CFile;
38
39         /// typedef ///
40         typedef CObjectTemplate<CField>   SuperClass;
41         typedef CFieldAttributes SuperClassAttribute;
42
43      public :
44
45         typedef CFieldAttributes RelAttributes;
46         typedef CFieldGroup      RelGroup;
47
48         /// Constructeurs ///
49         CField(void);
50         explicit CField(const StdString & id);
51         CField(const CField & field);       // Not implemented yet.
52         CField(const CField * const field); // Not implemented yet.
53
54         /// Accesseurs ///
55         boost::shared_ptr<CField> getDirectFieldReference(void) const;
56         const boost::shared_ptr<CField> getBaseFieldReference(void) const;
57         const std::vector<boost::shared_ptr<CField> > & getAllReference(void) const;
58
59         boost::shared_ptr<CGrid> getRelGrid(void) const ;
60         boost::shared_ptr<CFile> getRelFile(void) const ;
61         
62         const date::CDuration & getFreqOperation(void) const;
63         const date::CDuration & getFreqWrite(void) const;
64         
65         boost::shared_ptr<func::CFunctor> getFieldOperation(void) const;
66         
67         ARRAY(double, 1) getData(void) const;
68
69         const StdString & getBaseFieldId(void) const;
70
71         /// Mutateur ///
72         void setRelFile(const boost::shared_ptr<CFile> _file);
73
74      public :
75
76         /// Test ///
77         bool hasDirectFieldReference(void) const;
78
79         /// Traitements ///
80         void solveRefInheritance(void);
81         void solveGridReference(void);
82         void solveOperation(void);
83
84         virtual void fromBinary(StdIStream & is);
85
86         /// Destructeur ///
87         virtual ~CField(void);
88
89         /// Accesseurs statiques ///
90         static StdString GetName(void);
91         static StdString GetDefName(void);
92         
93         static ENodeType GetType(void);
94
95      private :
96
97         /// Propriétés privées ///
98         
99         std::vector<boost::shared_ptr<CField> > refObject;
100         boost::shared_ptr<CField> baseRefObject;
101         boost::shared_ptr<CGrid>  grid ;
102         boost::shared_ptr<CFile>  file;
103
104         date::CDuration freq_operation, freq_write;
105         boost::shared_ptr<func::CFunctor> foperation;
106         
107         ARRAY(double, 1) data;
108
109   }; // class CField
110
111   ///--------------------------------------------------------------
112
113   // Declare/Define CFieldGroup and CFieldDefinition
114   DECLARE_GROUP(CField);
115
116   } // namespace tree
117
118   ///-----------------------------------------------------------------
119
120   template <>
121      void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void);
122
123} // namespace xmlioserver
124
125#endif // __XMLIO_CField__
Note: See TracBrowser for help on using the repository browser.