Listing 3
#include <string> #include "shape.h" class PieDataItem{ public: double value; std::string label; Shape appearance; public: PieDataItem(const double v,const std::string l,const int fill_col, const int fill_op=100,const int line_col=0x000000, const int line_sz=1,const int line_op=100):value(v), label(l),appearance(line_sz,line_col,fill_col,line_op,fill_op){} }; /** Functor for use by accumulate */ double get_value(double v,const PieDataItem &d){ return v+d.value; }