00001
00007 #ifndef __VALUEGENCONTAINER_H__
00008 #define __VALUEGENCONTAINER_H__
00009
00010 #include <vector>
00011 #include <algorithm>
00012 #include <functional>
00013
00014 #include "vgen.h"
00015 #include "genericalgs.h"
00016
00017
00019 class ValueGenContainer : public ValueGen {
00020 public:
00021 virtual ~ValueGenContainer() { Generic::delete_contents(c); }
00022
00023 virtual void reset()
00024 { std::for_each(c.begin(),c.end(),std::mem_fun(&ValueGen::reset)); }
00025
00026 virtual bool next()
00027 { return std::count_if(c.begin(),c.end(),std::mem_fun(&ValueGen::next)); }
00028
00031 virtual void push_back(ValueGen* v) { c.push_back(v); }
00032
00033 protected:
00035 std::vector< ValueGen* > c;
00036 };
00037
00038
00039 #endif