dataset.hpp 985 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef dataset_hpp
  2. #define dataset_hpp
  3. #include "value.hpp"
  4. #include "container.hpp"
  5. namespace filval{
  6. class DataSet{
  7. protected:
  8. ValueSet values;
  9. ContainerSet containers;
  10. virtual bool load_next() = 0;
  11. public:
  12. void process(){
  13. while( load_next() ){
  14. for(auto val : values)
  15. val.second->reset();
  16. for(auto con : containers)
  17. con.second->fill();
  18. }
  19. }
  20. void add_value(GenValue *value, const std::string& value_name ){
  21. values[value_name] = value;
  22. }
  23. GenValue* get_value(std::string value_name){
  24. return values[value_name];
  25. }
  26. void add_container(GenContainer *container){
  27. containers[container->get_name()] = container;
  28. }
  29. GenContainer* get_container(std::string container_name){
  30. return containers[container_name];
  31. }
  32. };
  33. }
  34. #endif // dataset_hpp