[152] | 1 | #include "functor.hpp" |
---|
| 2 | |
---|
| 3 | namespace xmlioserver |
---|
| 4 | { |
---|
| 5 | namespace func |
---|
| 6 | { |
---|
| 7 | /// ////////////////////// Définitions ////////////////////// /// |
---|
| 8 | |
---|
[205] | 9 | CFunctor::CFunctor(const StdString & id, ARRAY(double, 1) doutput) |
---|
| 10 | : SuperClass(id), doutput(doutput) |
---|
| 11 | { /* Ne rien faire de plus */ } |
---|
[152] | 12 | |
---|
| 13 | CFunctor::~CFunctor(void) |
---|
| 14 | { /* Ne rien faire de plus */ } |
---|
| 15 | |
---|
| 16 | //--------------------------------------------------------------- |
---|
| 17 | |
---|
| 18 | ARRAY(double, 1) CFunctor::getDataOutput(void) const |
---|
[205] | 19 | { |
---|
| 20 | return (this->doutput); |
---|
[152] | 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 | if (dinput->size() != this->doutput->size()) |
---|
| 42 | ERROR("CFunctor::operator ()(dinput)", |
---|
| 43 | << "[ input size = " << dinput->size() |
---|
| 44 | << ", output size = " << this->doutput->size() << " ]" |
---|
| 45 | << " size of input array != size of output array !"); |
---|
[205] | 46 | this->apply(dinput, this->doutput); |
---|
[152] | 47 | return (this->doutput); |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | //--------------------------------------------------------------- |
---|
| 51 | |
---|
| 52 | } // namespace func |
---|
| 53 | } // namespace xmlioserver |
---|