35 #include "container.hpp" 40 typedef std::map<std::string, GenContainer*> ContainerSet;
53 INFO(GenValue::summary());
54 INFO(GenFunction::summary());
58 ContainerSet containers;
59 virtual bool load_next() = 0;
60 virtual int get_events() = 0;
61 virtual int get_current_event() = 0;
64 void process(
bool silent=
false){
65 int events, current_event;
67 events = get_events();
68 if (!silent) std::cout << std::endl;
70 current_event = get_current_event();
71 if (!silent) std::cout <<
"\rprocessing event: " << current_event+1 <<
"/" << events << std::flush;
73 for(
auto con : containers){
77 if (!silent) std::cout <<
" Finished!" << std::endl;
80 virtual void save_all(){
81 for(
auto container : containers)
82 container.second->save();
85 GenContainer* register_container(GenContainer *container){
86 if (containers[container->get_name()] !=
nullptr){
87 CRITICAL(
"Container with name \""+container->get_name()+
"\" already exists.", -1);
89 containers[container->get_name()] = container;
93 GenContainer* get_container(std::string container_name){
94 GenContainer* c = containers[container_name];
96 CRITICAL(
"Request for container \"" << container_name <<
"\" failed. Doesn't exist.", -1);
102 #endif // dataset_hpp The namespace containing all filval classes and functions.
Definition: api.hpp:6