source: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp @ 1870

Last change on this file since 1870 was 1870, checked in by ymipsl, 4 years ago

Some update on XIOS_COUPLING branch...

YM

File size: 3.7 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 "attribute_array.hpp"
13#include "transformation.hpp"
14#include "transformation_enum.hpp"
15
16namespace xios
17{
18      /// ////////////////////// Déclarations ////////////////////// ///
19
20      class CScalarGroup;
21      class CScalarAttributes;
22      class CScalar;
23      ///--------------------------------------------------------------
24
25      // Declare/Define CVarAttribute
26      BEGIN_DECLARE_ATTRIBUTE_MAP(CScalar)
27#include "scalar_attribute.conf"
28      END_DECLARE_ATTRIBUTE_MAP(CScalar)
29
30      ///--------------------------------------------------------------
31
32      class CScalar
33         : public CObjectTemplate<CScalar>
34         , public CScalarAttributes
35      {
36            /// typedef ///
37            typedef CObjectTemplate<CScalar>   SuperClass;
38            typedef CScalarAttributes SuperClassAttribute;
39
40            friend class CScalarGroup;
41
42         public :
43
44            typedef CScalarAttributes RelAttributes;
45            typedef CScalarGroup      RelGroup;
46            typedef CTransformation<CScalar>::TransformationMapTypes TransMapTypes;
47
48            /// Constructeurs ///
49            CScalar(void);
50            explicit CScalar(const StdString & id);
51            CScalar(const CScalar & var);       // Not implemented yet.
52            CScalar(const CScalar * const var); // Not implemented yet.
53
54            /// Destructeur ///
55            virtual ~CScalar(void);
56
57         public :
58            /// Accesseurs statiques ///
59            static StdString GetName(void);
60            static StdString GetDefName(void);
61            static ENodeType GetType(void);
62
63         public:
64            static CScalar* createScalar();
65
66         public:
67            void checkAttributes(void);
68            bool checkAttributes_done_ = false ;
69           
70            void addRelFile(const StdString& filename);
71            bool IsWritten(const StdString& filename) const;
72            void checkAttributesOnClient();
73            virtual void parse(xml::CXMLNode & node);
74
75            bool checkIfCompleted(void) ;
76            void setCompleted(void) ;
77            void setUncompleted(void) ;
78         
79         public:
80            void sendScalarToFileServer(CContextClient* client) ;
81         private:
82            std::set<CContextClient*> sendScalarToFileServer_done_ ;
83
84         public:
85           bool hasTransformation();
86           void solveInheritanceTransformation();
87           TransMapTypes getAllTransformations();
88           void duplicateTransformation(CScalar*);
89           CTransformation<CScalar>* addTransformation(ETranformationType transType, const StdString& id="");
90           bool isEqual(CScalar* scalar);
91
92         private:
93           std::set<StdString> relFiles;
94           TransMapTypes transformationMap_;
95
96            void setTransformations(const TransMapTypes&);
97
98       private:
99           static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m);
100           static std::map<StdString, ETranformationType> transformationMapList_;
101           static bool dummyTransformationMapList_;
102
103           /** define if the scalar is completed or not ie all attributes have been received before in case
104               of grid reading from file or coupling */ 
105           bool isCompleted_=true ; 
106
107            DECLARE_REF_FUNC(Scalar,scalar)
108
109      }; // class CVar
110      ///--------------------------------------------------------------
111
112      // Declare/Define CScalarGroup and CScalarDefinition
113      DECLARE_GROUP(CScalar);
114} // namespace xios
115
116#endif // __XIOS_CScalar__
Note: See TracBrowser for help on using the repository browser.