#ifndef _reproducer_h_ #define _reproducer_h_ #include #include class FunctionBase{ public: FunctionBase(){ std::cout << "FunctionBase::" << __func__ << std::endl; } virtual ~FunctionBase(){ std::cout << "FunctionBase::" << __func__ << std::endl; } virtual double operator()(double x) const{ std::cout << "FunctionBase::" << __func__ << std::endl; return x+1; } virtual double func1(double x) const{ std::cout << "FunctionBase::" << __func__ << std::endl; return -x; } }; class FunctionDerived1: public FunctionBase{ public: FunctionDerived1(): FunctionBase() { std::cout << "FunctionBase::" << __func__ << std::endl; } virtual ~FunctionDerived1(){ std::cout << "FunctionBase::" << __func__ << std::endl; } virtual double operator()(double x) const{ std::cout << "FunctionDerived1::" << __func__ << std::endl; return x; } virtual double func1(double x) const{ std::cout << "FunctionDerived1::" << __func__ << std::endl; return -x; } }; class FunctionDerived2: public FunctionBase{ public: FunctionDerived2(): FunctionBase(){ std::cout << "FunctionDerived2::" << __func__ << std::endl; } virtual ~FunctionDerived2(){ std::cout << "FunctionDerived2::" << __func__ << std::endl; } virtual double operator()(double x) const{ std::cout << "FunctionDerived2::" << __func__ << std::endl; return x; } virtual double func1(double x) const{ std::cout << "FunctionDerived2::" << __func__ << std::endl; return -x; } }; class Base{ public: std::vector* elements; Base(std::vector* _elements): elements(_elements){ } virtual ~Base(){} }; #endif