source: XIOS/dev/XIOS_DEV_CMIP6/src/node/scalar.hpp @ 1301

Last change on this file since 1301 was 1158, checked in by oabramkina, 7 years ago

Two server levels: merging with trunk r1137.
There are bugs.

File size: 3.1 KB
Line 
1#ifndef __XIOS_CScalar__
2#define __XIOS_CScalar__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "declare_group.hpp"
7#include "declare_ref_func.hpp"
8#include "group_template.hpp"
9#include "array_new.hpp"
10#include "attribute_enum.hpp"
11#include "attribute_enum_impl.hpp"
12#include "transformation.hpp"
13#include "transformation_enum.hpp"
14
15namespace xios
16{
17      /// ////////////////////// Déclarations ////////////////////// ///
18
19      class CScalarGroup;
20      class CScalarAttributes;
21      class CScalar;
22      ///--------------------------------------------------------------
23
24      // Declare/Define CVarAttribute
25      BEGIN_DECLARE_ATTRIBUTE_MAP(CScalar)
26#include "scalar_attribute.conf"
27      END_DECLARE_ATTRIBUTE_MAP(CScalar)
28
29      ///--------------------------------------------------------------
30
31      class CScalar
32         : public CObjectTemplate<CScalar>
33         , public CScalarAttributes
34      {
35            /// typedef ///
36            typedef CObjectTemplate<CScalar>   SuperClass;
37            typedef CScalarAttributes SuperClassAttribute;
38
39            friend class CScalarGroup;
40
41         public :
42
43            typedef CScalarAttributes RelAttributes;
44            typedef CScalarGroup      RelGroup;
45            typedef CTransformation<CScalar>::TransformationMapTypes TransMapTypes;
46
47            /// Constructeurs ///
48            CScalar(void);
49            explicit CScalar(const StdString & id);
50            CScalar(const CScalar & var);       // Not implemented yet.
51            CScalar(const CScalar * const var); // Not implemented yet.
52
53            /// Destructeur ///
54            virtual ~CScalar(void);
55
56         public :
57            /// Accesseurs statiques ///
58            static StdString GetName(void);
59            static StdString GetDefName(void);
60            static ENodeType GetType(void);
61
62         public:
63            static CScalar* createScalar();
64
65         public:
66            void checkAttributes(void);
67            void addRelFile(const StdString& filename);
68            bool IsWritten(const StdString& filename) const;
69            void checkAttributesOnClient();
70            virtual void parse(xml::CXMLNode & node);
71
72         public:
73           bool hasTransformation();
74           void solveInheritanceTransformation();
75           TransMapTypes getAllTransformations();
76           void duplicateTransformation(CScalar*);
77           CTransformation<CScalar>* addTransformation(ETranformationType transType, const StdString& id="");
78           bool isEqual(CScalar* scalar);
79
80         private:
81           std::set<StdString> relFiles;
82           TransMapTypes transformationMap_;
83
84            void setTransformations(const TransMapTypes&);
85
86       private:
87           static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m);
88           static std::map<StdString, ETranformationType> transformationMapList_;
89           static bool dummyTransformationMapList_;
90
91
92            DECLARE_REF_FUNC(Scalar,scalar)
93
94      }; // class CVar
95      ///--------------------------------------------------------------
96
97      // Declare/Define CScalarGroup and CScalarDefinition
98      DECLARE_GROUP(CScalar);
99} // namespace xios
100
101#endif // __XIOS_CScalar__
Note: See TracBrowser for help on using the repository browser.