/*********************************************************************** * registration **********************************************************************/ static Pothos::Block *DCRemovalFactory(const Pothos::DType &dtype) { #define ifTypeDeclareFactory__(Type, AccType) \ if (dtype == Pothos::DType(typeid(Type))) return new DCRemoval<Type, AccType>(); #define ifTypeDeclareFactory(Type, AccType) \ ifTypeDeclareFactory__(Type, AccType) \ ifTypeDeclareFactory__(std::complex<Type>, std::complex<AccType>) ifTypeDeclareFactory(double, double); ifTypeDeclareFactory(float, float); ifTypeDeclareFactory(int64_t, int64_t); ifTypeDeclareFactory(int32_t, int64_t); ifTypeDeclareFactory(int16_t, int32_t); ifTypeDeclareFactory(int8_t, int16_t); throw Pothos::InvalidArgumentException("DCRemovalFactory("+dtype.toString()+")", "unsupported type"); }
/*********************************************************************** * registration **********************************************************************/ static Pothos::Block *angleFactory(const Pothos::DType &dtype) { #define ifTypeDeclareFactory_(intype, outtype) \ if (Pothos::DType::fromDType(dtype, 1) == Pothos::DType(typeid(intype))) \ return new Angle<intype, outtype>(dtype.dimension()); #define ifTypeDeclareFactory(type) \ ifTypeDeclareFactory_(std::complex<type>, type) ifTypeDeclareFactory(double); ifTypeDeclareFactory(float); ifTypeDeclareFactory(int64_t); ifTypeDeclareFactory(int32_t); ifTypeDeclareFactory(int16_t); ifTypeDeclareFactory(int8_t); throw Pothos::InvalidArgumentException("angleFactory("+dtype.toString()+")", "unsupported type"); }
/*********************************************************************** * registration **********************************************************************/ static Pothos::Block *FIRFilterFactory(const Pothos::DType &dtype, const std::string &tapsType) { #define ifTypeDeclareFactory__(Type, tapsTypeVal, TapsType) \ if (dtype == Pothos::DType(typeid(Type)) and tapsType == tapsTypeVal) return new FIRFilter<Type, Type, TapsType>(); #define ifTypeDeclareFactory(type) \ ifTypeDeclareFactory__(type, "REAL", type) \ ifTypeDeclareFactory__(std::complex<type>, "REAL", type) \ ifTypeDeclareFactory__(std::complex<type>, "COMPLEX", std::complex<type>) ifTypeDeclareFactory(double); ifTypeDeclareFactory(float); ifTypeDeclareFactory(int64_t); ifTypeDeclareFactory(int32_t); ifTypeDeclareFactory(int16_t); ifTypeDeclareFactory(int8_t); throw Pothos::InvalidArgumentException("FIRFilterFactory("+dtype.toString()+")", "unsupported types"); }
/*********************************************************************** * registration **********************************************************************/ static Pothos::Block *arithmeticFactory(const Pothos::DType &dtype, const std::string &operation) { #define ifTypeDeclareFactory__(type, opKey, opVal) \ if (Pothos::DType::fromDType(dtype, 1) == Pothos::DType(typeid(type)) and operation == opKey) \ return new Arithmetic<type, opVal<type>>(dtype.dimension()); #define ifTypeDeclareFactory_(type) \ ifTypeDeclareFactory__(type, "ADD", addArray) \ ifTypeDeclareFactory__(type, "SUB", subArray) \ ifTypeDeclareFactory__(type, "MUL", mulArray) \ ifTypeDeclareFactory__(type, "DIV", divArray) #define ifTypeDeclareFactory(type) \ ifTypeDeclareFactory_(type) \ ifTypeDeclareFactory_(std::complex<type>) ifTypeDeclareFactory(double); ifTypeDeclareFactory(float); ifTypeDeclareFactory(int64_t); ifTypeDeclareFactory(int32_t); ifTypeDeclareFactory(int16_t); ifTypeDeclareFactory(int8_t); throw Pothos::InvalidArgumentException("arithmeticFactory("+dtype.toString()+", "+operation+")", "unsupported args"); }