source: XIOS/dev/XIOS_DEV_CMIP6/src/functor.cpp @ 1472

Last change on this file since 1472 was 501, checked in by ymipsl, 9 years ago

Add licence copyright to all file ond directory src using the command :
svn propset -R copyright -F header_licence src

XIOS is now officialy under CeCILL licence

YM

  • 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
File size: 2.0 KB
Line 
1#include "functor.hpp"
2#include "array_new.hpp"
3
4namespace xios
5{
6   namespace func
7   {
8      /// ////////////////////// Définitions ////////////////////// ///
9
10      CFunctor::CFunctor(const StdString & id, CArray<double, 1>& doutput)
11         : SuperClass(id), doutput(doutput), nbcall(0),hasMissingValue(false)
12      { /* Ne rien faire de plus */  }
13 
14      CFunctor::CFunctor(const StdString & id, CArray<double, 1>& doutput, double missingValue)
15         : SuperClass(id), doutput(doutput), nbcall(0),hasMissingValue(true),missingValue(missingValue)
16      { 
17        /* Ne rien faire de plus */
18      }
19
20      CFunctor::~CFunctor(void)
21      { /* Ne rien faire de plus */ }
22
23      //---------------------------------------------------------------
24
25      CArray<double,1> CFunctor::getDataOutput(void) const
26      { 
27         return (this->doutput);
28      }
29
30      //---------------------------------------------------------------
31
32      StdString CFunctor::toString(void) const
33      {
34         ERROR("CFunctor::toString()", << "Not implemented yet !");
35         return (SuperClass::getId());
36      }
37
38      void CFunctor::fromString(const StdString & str)
39      {
40         ERROR("CFunctor::fromString(str)",
41                << "[ str = " << str << "] Not implemented yet !");
42      }
43
44      //---------------------------------------------------------------
45
46      CArray<double,1> CFunctor::operator ()(const CArray<double,1>& dinput)
47      {
48         this->nbcall++;
49         if (dinput.numElements() != this->doutput.numElements())
50            ERROR("CFunctor::operator ()(dinput)",
51                   << "[ input size = "  << dinput.numElements()
52                   << ", output size = " << this->doutput.numElements() << " ]"
53                   << " size of input array !=  size of output array !");
54         this->apply(dinput, this->doutput);
55         return (this->doutput);
56      }
57
58      void CFunctor::final(void) 
59      {
60        this->nbcall = 0;
61      } 
62
63      //---------------------------------------------------------------
64
65   } // namespace func
66} // namespace xios
Note: See TracBrowser for help on using the repository browser.