1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
#ifndef MyProcessing_hxx
#define MyProcessing_hxx
#include <CLAM/InPort.hxx>
#include <CLAM/OutPort.hxx>
#include <CLAM/Processing.hxx>
#include <CLAM/Spectrum.hxx>
class MyProcessing : public CLAM::Processing
{
CLAM::InPort<CLAM::Spectrum> mIn;
CLAM::OutPort<CLAM::Spectrum> mOut;
public:
const char* GetClassName() const { return "MyProcessing"; }
MyProcessing(const Config& config = Config())
: mIn("My Input", this)
, mOut("My Output", this)
{
Configure( config );
}
bool Do()
{
bool result = Do(mIn.GetData(), mOut.GetData());
// Tell the ports this is done
mIn.Consume();
mOut.Produce();
return result;
}
bool Do(const CLAM::Spectrum& in, CLAM::Spectrum& out)
{
// Your implementation
return true;
}
};
#endif // MyProcessing_hxx
|