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
RevLine 
[591]1#ifndef __XIOS_CAxis__
2#define __XIOS_CAxis__
[219]3
[591]4/// XIOS headers ///
5#include "xios_spl.hpp"
[219]6#include "group_factory.hpp"
[619]7#include "virtual_node.hpp"
[219]8
9#include "declare_group.hpp"
[540]10#include "declare_ref_func.hpp"
[619]11#include "declare_virtual_node.hpp"
[369]12#include "attribute_array.hpp"
[399]13#include "attribute_enum.hpp"
14#include "attribute_enum_impl.hpp"
[567]15#include "server_distribution_description.hpp"
[619]16#include "transformation.hpp"
17#include "transformation_enum.hpp"
[219]18
[335]19namespace xios {
[219]20   /// ////////////////////// Déclarations ////////////////////// ///
21
22   class CAxisGroup;
23   class CAxisAttributes;
24   class CAxis;
[619]25   class CTransformationGroup;
26   class CVirtualTransformationGroup;
[219]27
[619]28   DECLARE_VIRTUAL_NODE(TransformationGroup);
[219]29   ///--------------------------------------------------------------
30
31   // Declare/Define CAxisAttribute
32   BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
[231]33#  include "axis_attribute.conf"
[219]34   END_DECLARE_ATTRIBUTE_MAP(CAxis)
35
36   ///--------------------------------------------------------------
37
38   class CAxis
39      : public CObjectTemplate<CAxis>
40      , public CAxisAttributes
[619]41      , public CVirtualTransformationGroup
[219]42   {
[567]43         enum EEventId
44         {
45           EVENT_ID_SERVER_ATTRIBUT
46         } ;
47
[219]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;
[594]68         bool isDistributed(void) const;
[219]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
[619]79         virtual void parse(xml::CXMLNode & node);
80
[219]81         /// Accesseurs statiques ///
82         static StdString GetName(void);
83         static StdString GetDefName(void);
84         static ENodeType GetType(void);
85
[595]86         void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
87                                 CServerDistributionDescription::ServerDistributionType distType);
[567]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);
[619]95
96         bool hasTransformation();
97         void solveInheritanceTransformation();
[620]98         std::vector<CTransformation*> getAllTransformations();
[619]99
[567]100      public:
101        int zoom_begin_srv, zoom_end_srv, zoom_size_srv;
102        int ni_srv, begin_srv, end_srv;
[595]103
[219]104      private :
[551]105         void checkData();
106         void checkMask();
[567]107         void checkZoom();
[595]108
[619]109
[620]110
111         void setTransformations(const std::vector<CTransformation*>&);
[567]112      private:
[219]113         bool isChecked;
[567]114         bool areClientAttributesChecked_;
[219]115         std::set<StdString> relFiles;
[620]116         std::vector<CTransformation*> transformations_;
[594]117         bool isDistributed_;
[219]118
[540]119         DECLARE_REF_FUNC(Axis,axis)
[219]120   }; // class CAxis
121
122   ///--------------------------------------------------------------
123
124   // Declare/Define CAxisGroup and CAxisDefinition
125   DECLARE_GROUP(CAxis);
[335]126} // namespace xios
[219]127
[591]128#endif // __XIOS_CAxis__
Note: See TracBrowser for help on using the repository browser.