[591] | 1 | #ifndef __XIOS_CFunctor__ |
---|
| 2 | #define __XIOS_CFunctor__ |
---|
[219] | 3 | |
---|
[591] | 4 | /// XIOS headers /// |
---|
| 5 | #include "xios_spl.hpp" |
---|
[219] | 6 | #include "exception.hpp" |
---|
[369] | 7 | #include "array_new.hpp" |
---|
[219] | 8 | |
---|
[335] | 9 | namespace xios |
---|
[219] | 10 | { |
---|
| 11 | namespace func |
---|
| 12 | { |
---|
| 13 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 14 | class CFunctor : public CObject |
---|
| 15 | { |
---|
| 16 | /// Définition de type /// |
---|
| 17 | typedef CObject SuperClass; |
---|
| 18 | public : |
---|
[449] | 19 | enum ETimeType { once, instant, centered } ; |
---|
[219] | 20 | |
---|
| 21 | /// Accesseurs /// |
---|
[369] | 22 | CArray<double,1> getDataOutput(void) const; |
---|
[219] | 23 | /// Opérateur /// |
---|
[369] | 24 | CArray<double,1> operator ()(const CArray<double,1>& dinput); |
---|
[449] | 25 | virtual ETimeType timeType(void) = 0 ; |
---|
[219] | 26 | |
---|
| 27 | /// Destructeur /// |
---|
| 28 | virtual ~CFunctor(void); |
---|
| 29 | |
---|
[266] | 30 | //Traitement /// |
---|
| 31 | virtual void final(void); |
---|
| 32 | |
---|
[219] | 33 | protected : |
---|
| 34 | |
---|
| 35 | /// Traitement /// |
---|
[369] | 36 | virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput) = 0; |
---|
[219] | 37 | |
---|
| 38 | /// Autres /// |
---|
| 39 | virtual StdString toString(void) const; |
---|
| 40 | virtual void fromString(const StdString & str); |
---|
| 41 | |
---|
| 42 | /// Constructeurs /// |
---|
| 43 | CFunctor(void); // Not implemented. |
---|
[369] | 44 | CFunctor(const StdString & id, CArray<double,1>& doutput); |
---|
[471] | 45 | CFunctor(const StdString & id, CArray<double,1>& doutput, double missingValue); |
---|
| 46 | CFunctor(const CFunctor & functor); // Not implemented. |
---|
[219] | 47 | CFunctor(const CFunctor * const functor); // Not implemented. |
---|
[369] | 48 | protected : |
---|
[219] | 49 | /// Propriétés privées /// |
---|
[369] | 50 | CArray<double,1>& doutput; |
---|
[266] | 51 | /// Propriétés protégées /// |
---|
| 52 | int nbcall; |
---|
[471] | 53 | bool hasMissingValue ; |
---|
| 54 | double missingValue ; |
---|
| 55 | CArray<int,1> nbcalls ; |
---|
[219] | 56 | }; // class CFunctor |
---|
| 57 | } // namespace func |
---|
[335] | 58 | } // namespace xios |
---|
[219] | 59 | |
---|
[352] | 60 | //#include "functor_type.hpp" |
---|
[219] | 61 | |
---|
[591] | 62 | #endif // __XIOS_CFunctor__ |
---|