[3428] | 1 | #include "functor.hpp" |
---|
| 2 | |
---|
| 3 | namespace xios |
---|
| 4 | { |
---|
| 5 | namespace func |
---|
| 6 | { |
---|
| 7 | /// ////////////////////// Définitions ////////////////////// /// |
---|
| 8 | |
---|
| 9 | CFunctor::CFunctor(const StdString & id, ARRAY(double, 1) doutput) |
---|
| 10 | : SuperClass(id), doutput(doutput), nbcall(0) |
---|
| 11 | { /* Ne rien faire de plus */ } |
---|
| 12 | |
---|
| 13 | CFunctor::~CFunctor(void) |
---|
| 14 | { /* Ne rien faire de plus */ } |
---|
| 15 | |
---|
| 16 | //--------------------------------------------------------------- |
---|
| 17 | |
---|
| 18 | ARRAY(double, 1) CFunctor::getDataOutput(void) const |
---|
| 19 | { |
---|
| 20 | return (this->doutput); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | //--------------------------------------------------------------- |
---|
| 24 | |
---|
| 25 | StdString CFunctor::toString(void) const |
---|
| 26 | { |
---|
| 27 | ERROR("CFunctor::toString()", << "Not implemented yet !"); |
---|
| 28 | return (SuperClass::getId()); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | void CFunctor::fromString(const StdString & str) |
---|
| 32 | { |
---|
| 33 | ERROR("CFunctor::fromString(str)", |
---|
| 34 | << "[ str = " << str << "] Not implemented yet !"); |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | //--------------------------------------------------------------- |
---|
| 38 | |
---|
| 39 | ARRAY(double, 1) CFunctor::operator ()(const ARRAY(double, 1) dinput) |
---|
| 40 | { |
---|
| 41 | this->nbcall++; |
---|
| 42 | if (dinput->size() != this->doutput->size()) |
---|
| 43 | ERROR("CFunctor::operator ()(dinput)", |
---|
| 44 | << "[ input size = " << dinput->size() |
---|
| 45 | << ", output size = " << this->doutput->size() << " ]" |
---|
| 46 | << " size of input array != size of output array !"); |
---|
| 47 | this->apply(dinput, this->doutput); |
---|
| 48 | return (this->doutput); |
---|
| 49 | } |
---|
| 50 | |
---|
| 51 | void CFunctor::final(void) |
---|
| 52 | { |
---|
| 53 | this->nbcall = 0; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | //--------------------------------------------------------------- |
---|
| 57 | |
---|
| 58 | } // namespace func |
---|
| 59 | } // namespace xios |
---|