source: XIOS3/trunk/src/node/reduce_domain_to_axis.hpp @ 2401

Last change on this file since 2401 was 2270, checked in by ymipsl, 3 years ago

Tracking memory leak :
Tranformations and algorithms are now managed with shared_ptr.

YM

File size: 3.5 KB
Line 
1#ifndef __XIOS_CReduceDomainToAxis__
2#define __XIOS_CReduceDomainToAxis__
3
4/// xios headers ///
5#include "xios_spl.hpp"
6#include "attribute_enum.hpp"
7#include "attribute_enum_impl.hpp"
8#include "attribute_array.hpp"
9#include "declare_attribute.hpp"
10#include "object_template.hpp"
11#include "group_factory.hpp"
12#include "declare_group.hpp"
13#include "transformation.hpp"
14
15namespace xios {
16  /// ////////////////////// Déclarations ////////////////////// ///
17  class CReduceDomainToAxisGroup;
18  class CReduceDomainToAxisAttributes;
19  class CReduceDomainToAxis;
20  class CAxis;
21  class CDomain;
22  class CGenericAlgorithmTransformation ;
23  class CGrid;
24  ///--------------------------------------------------------------
25
26  // Declare/Define CFileAttribute
27  BEGIN_DECLARE_ATTRIBUTE_MAP(CReduceDomainToAxis)
28#include "reduce_domain_to_axis_attribute.conf"
29  END_DECLARE_ATTRIBUTE_MAP(CReduceDomainToAxis)
30
31  ///--------------------------------------------------------------
32  /*!
33    \class CReduceDomainToAxis
34    This class describes reduce_domain in xml file.
35  */
36  class CReduceDomainToAxis
37    : public CObjectTemplate<CReduceDomainToAxis>
38    , public CReduceDomainToAxisAttributes
39    , public CTransformation<CAxis>
40  {
41    public :
42      typedef CObjectTemplate<CReduceDomainToAxis> SuperClass;
43      typedef CReduceDomainToAxisAttributes SuperClassAttribute;
44      typedef CReduceDomainToAxis MyClass ;
45     typedef CTransformation<CAxis> SuperTransform ;
46
47    public :
48      /// Constructeurs ///
49      CReduceDomainToAxis(void);
50      explicit CReduceDomainToAxis(const StdString& id);
51
52      /// Destructeur ///
53      virtual ~CReduceDomainToAxis(void);
54
55      virtual void checkValid(CAxis* axisDst, CDomain* domainSrc);
56
57      /// Accesseurs statiques ///
58      static StdString GetName(void);
59      static StdString GetDefName(void);
60      static ENodeType GetType(void);
61      const string& getId(void) { return this->SuperClass::getId();}
62      ETranformationType getTransformationType(void) { return TRANS_REDUCE_DOMAIN_TO_AXIS ;}
63      static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
64      virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
65      virtual shared_ptr<CGenericAlgorithmTransformation> createAlgorithm(bool isSource,
66                                                               CGrid* gridDst, CGrid* gridSrc,
67                                                               int elementPositionInGrid,
68                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
69                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
70                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
71                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
72                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
73                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
74     private:
75      static bool registerTrans();
76      static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
77      static bool _dummyRegistered;
78  }; // class CReduceDomainToAxis
79
80  DECLARE_GROUP(CReduceDomainToAxis);
81} // namespace xios
82
83#endif // __XIOS_CReduceDomainToAxis__
Note: See TracBrowser for help on using the repository browser.