source: XIOS/trunk/src/node/axis.hpp @ 620

Last change on this file since 620 was 620, checked in by mhnguyen, 9 years ago

Implementing generic transformation algorithm (local commit)

+) Implement 3 important classes:

-gridTransformation to read transformation info from grid and interface with the rest of XIOS
-transformationMapping to be in charge of sending/receiving transformation info among clients
-transformationAlgorithm to represent various algorithms

+) Make some change on field to use the new classes

Test
+) Only test_new_features with inversed axis

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:executable set to *
File size: 4.0 KB
Line 
1#ifndef __XIOS_CAxis__
2#define __XIOS_CAxis__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "group_factory.hpp"
7#include "virtual_node.hpp"
8
9#include "declare_group.hpp"
10#include "declare_ref_func.hpp"
11#include "declare_virtual_node.hpp"
12#include "attribute_array.hpp"
13#include "attribute_enum.hpp"
14#include "attribute_enum_impl.hpp"
15#include "server_distribution_description.hpp"
16#include "transformation.hpp"
17#include "transformation_enum.hpp"
18
19namespace xios {
20   /// ////////////////////// Déclarations ////////////////////// ///
21
22   class CAxisGroup;
23   class CAxisAttributes;
24   class CAxis;
25   class CTransformationGroup;
26   class CVirtualTransformationGroup;
27
28   DECLARE_VIRTUAL_NODE(TransformationGroup);
29   ///--------------------------------------------------------------
30
31   // Declare/Define CAxisAttribute
32   BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
33#  include "axis_attribute.conf"
34   END_DECLARE_ATTRIBUTE_MAP(CAxis)
35
36   ///--------------------------------------------------------------
37
38   class CAxis
39      : public CObjectTemplate<CAxis>
40      , public CAxisAttributes
41      , public CVirtualTransformationGroup
42   {
43         enum EEventId
44         {
45           EVENT_ID_SERVER_ATTRIBUT
46         } ;
47
48         /// typedef ///
49         typedef CObjectTemplate<CAxis>   SuperClass;
50         typedef CAxisAttributes SuperClassAttribute;
51
52      public :
53
54         typedef CAxisAttributes RelAttributes;
55         typedef CAxisGroup      RelGroup;
56
57         /// Constructeurs ///
58         CAxis(void);
59         explicit CAxis(const StdString & id);
60         CAxis(const CAxis & axis);       // Not implemented yet.
61         CAxis(const CAxis * const axis); // Not implemented yet.
62
63         /// Accesseurs ///
64         const std::set<StdString> & getRelFiles(void) const;
65
66         /// Test ///
67         bool IsWritten(const StdString & filename) const;
68         bool isDistributed(void) const;
69
70         /// Mutateur ///
71         void addRelFile(const StdString & filename);
72
73         /// Vérifications ///
74         void checkAttributes(void);
75
76         /// Destructeur ///
77         virtual ~CAxis(void);
78
79         virtual void parse(xml::CXMLNode & node);
80
81         /// Accesseurs statiques ///
82         static StdString GetName(void);
83         static StdString GetDefName(void);
84         static ENodeType GetType(void);
85
86         void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
87                                 CServerDistributionDescription::ServerDistributionType distType);
88         static bool dispatchEvent(CEventServer& event);
89         static void recvServerAttribut(CEventServer& event);
90         void recvServerAttribut(CBufferIn& buffer) ;
91         void checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid,
92                                      CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
93         void sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
94                                    CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
95
96         bool hasTransformation();
97         void solveInheritanceTransformation();
98         std::vector<CTransformation*> getAllTransformations();
99
100      public:
101        int zoom_begin_srv, zoom_end_srv, zoom_size_srv;
102        int ni_srv, begin_srv, end_srv;
103
104      private :
105         void checkData();
106         void checkMask();
107         void checkZoom();
108
109
110
111         void setTransformations(const std::vector<CTransformation*>&);
112      private:
113         bool isChecked;
114         bool areClientAttributesChecked_;
115         std::set<StdString> relFiles;
116         std::vector<CTransformation*> transformations_;
117         bool isDistributed_;
118
119         DECLARE_REF_FUNC(Axis,axis)
120   }; // class CAxis
121
122   ///--------------------------------------------------------------
123
124   // Declare/Define CAxisGroup and CAxisDefinition
125   DECLARE_GROUP(CAxis);
126} // namespace xios
127
128#endif // __XIOS_CAxis__
Note: See TracBrowser for help on using the repository browser.