#include "block.h" #include using std::complex; class ComplexReal : public Block { private: InPort < complex < double > > * in; OutPort < double > * out; public: ComplexReal(const Blockopt & blockopt) : Block(blockopt) {} void makeIOPorts() { in = new InPort < complex < double > > (this, "in", 1); out = new OutPort < double > (this, "out", 1); } void go() { out->write(real(in->read())); } }; PUBLISH(ComplexReal);