#ifndef __XMLIO_CFunctor__ #define __XMLIO_CFunctor__ /// xmlioserver headers /// #include "xmlioserver_spl.hpp" #include "exception.hpp" #include "array.hpp" namespace xmlioserver { namespace func { /// ////////////////////// Déclarations ////////////////////// /// class CFunctor : private CObject { /// Définition de type /// typedef CObject SuperClass; typedef ARRAY(double, 1) DoubleArray; public : typedef enum func_type { SPATIAL = 0, TEMPORAL } CFuncType; typedef struct func_data { int timestep; } CFunData; /// Accesseurs /// CFuncType getType(void) const; StdSize getSize(void) const; const CFunData & getData(void) const; const std::vector & getShape(void) const; DoubleArray getDataOutput(void) const; /// Mutateur /// void resize(StdSize x, StdSize y = 1, StdSize z = 1); void resize(const std::vector & sizes); /// Opérateur /// DoubleArray operator ()(const DoubleArray dinput); /// Destructeur /// virtual ~CFunctor(void); protected : /// Traitement /// virtual void apply(const DoubleArray dinput, DoubleArray doutput, const std::vector size, const CFunData & data) = 0; /// Autres /// virtual StdString toString(void) const; virtual void fromString(const StdString & str); /// Constructeurs /// CFunctor(void); // Not implemented. CFunctor(const StdString & id, DoubleArray doutput, const CFunData & data, CFuncType type = TEMPORAL); CFunctor(const StdString & id, DoubleArray doutput, const std::vector size, const CFunData & data, CFuncType type = TEMPORAL); CFunctor(const CFunctor & functor); // Not implemented. CFunctor(const CFunctor * const functor); // Not implemented. private : /// Propriétés privées /// DoubleArray doutput; std::vector size; CFunData data; CFuncType type; }; // class CFunctor } // namespace func } // namespace xmlioserver #include "functor_type.hpp" #endif // __XMLIO_CFunctor__