source: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.hpp @ 2338

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

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

YM

  • Property svn:executable set to *
File size: 1.2 KB
Line 
1#ifndef __XIOS_GRID_ALGORITHM_HPP__
2#define __XIOS_GRID_ALGORITHM_HPP__
3
4#include "grid_transform_connector.hpp"
5#include <map>
6#include "array_new.hpp"
7#include "local_view.hpp"
8
9namespace xios
10{
11  class CGrid;
12  class CGenericAlgorithmTransformation ;
13
14  /*!
15  \class CGenericAlgorithmTransformation
16  This class defines the interface for all other inherited algorithms class
17  */
18class CTransformFilter ;
19class CGarbageCollector ;
20
21class CGridAlgorithm : public std::enable_shared_from_this<CGridAlgorithm>
22{
23  public:
24    CGridAlgorithm(shared_ptr<CGenericAlgorithmTransformation> algorithm) : algorithm_(algorithm)  {} ;
25    virtual ~CGridAlgorithm() {} ;
26    virtual void apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut) { abort(); } //=0
27    virtual void apply(const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) { abort(); } //=0
28    virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, bool detectMissingValues, double defaultValue) ;
29    virtual bool isGenerateTranformation(void) ;
30    virtual StdString getAlgoName() ;
31   
32    protected:
33      shared_ptr<CGenericAlgorithmTransformation> algorithm_=nullptr ;
34};
35
36}
37#endif // __XIOS_GRID_ALGORITHM_TRANSFORMATION_HPP__
Note: See TracBrowser for help on using the repository browser.