11 std::string& get_type_name(
const std::type_index& index){
12 std::map<std::type_index, std::string> _map;
14 _map[
typeid(int)]=
"int";
15 _map[
typeid(
unsigned int)]=
"unsigned int";
16 _map[
typeid(float)]=
"float";
17 _map[
typeid(double)]=
"double";
19 if (_map[index] ==
""){
20 CRITICAL(
"Cannot lookup type name of \"" << index.name() <<
"\"",-1);
38 std::vector<Filter*> filters;
40 virtual void _fill() = 0;
42 GenContainer(
const std::string name,
const std::string& desc)
43 :name(name),desc(desc) { }
49 filters.push_back(dynamic_cast<Filter*>(filter));
53 for (
auto filter : filters){
54 if (!filter->get_value())
return;
59 void set_description(
const std::string& description){
62 const std::string& get_name(){
65 virtual void save_as(
const std::string& fname,
const SaveOption& option) = 0;
66 virtual void save(
const SaveOption& option=SaveOption::PNG) {
67 save_as(get_name(), option);
70 typedef std::map<std::string, GenContainer*> ContainerSet;
77 Container(
const std::string& name, H* container)
79 container(container){ }
80 virtual H* get_container(){
92 this->container->push_back(value->
get_value());
101 this->container =
new std::vector<T>();
103 void save_as(
const std::string& fname) {
104 WARNING(
"Saving of ContainerVector objects not supported");
108 template <
typename T>
123 this->container =
new T();
127 *(this->container) = sum/count;
128 return (this->container);
130 void save_as(
const std::string& fname) {
131 WARNING(
"Saving of ContainerMean objects not supported");
136 #endif // container_hpp Definition: value.hpp:213
Definition: container.hpp:87
Definition: argparse.hpp:39
Definition: container.hpp:109
The namespace containing all filval classes and functions.
Definition: api.hpp:6
A generic value.
Definition: value.hpp:338
Definition: container.hpp:34
virtual T & get_value()=0
Calculate, if necessary, and return the value held by this object.
Definition: container.hpp:73