40 template class std::vector<std::vector<float> >;
41 template class std::vector<std::vector<int> >;
44 std::string get_type_name(
const std::type_index& index){
45 std::map<std::type_index, std::string> _map;
47 _map[
typeid(int)]=
"int";
48 _map[
typeid(
unsigned int)]=
"unsigned int";
49 _map[
typeid(float)]=
"float";
50 _map[
typeid(double)]=
"double";
51 _map[
typeid(std::vector<int>)]=
"std::vector<int>";
52 _map[
typeid(std::vector<float>)]=
"std::vector<float>";
54 if (_map[index] ==
""){
55 CRITICAL(
"Cannot lookup type name of \"" << index.name() <<
"\"",-1);
81 std::vector<Filter*> filters;
83 virtual void _fill() = 0;
85 GenContainer(
const std::string name,
const std::string& desc)
86 :name(name),desc(desc) { }
91 void add_filter(GenValue* filter){
92 filters.push_back(dynamic_cast<Filter*>(filter));
96 for (
auto filter : filters){
97 if (!filter->get_value())
return;
102 void set_description(
const std::string& description){
105 const std::string& get_name(){
108 virtual void save_as(
const std::string& fname,
const SaveOption& option) = 0;
109 virtual void save(
const SaveOption& option=SaveOption::PNG) {
110 save_as(get_name(), option);
121 template <
typename H>
126 Container(
const std::string& name, H* container)
128 container(container){ }
129 virtual H* get_container(){
143 template <
typename T>
158 this->container =
new T();
162 *(this->container) = sum/count;
163 return (this->container);
165 void save_as(
const std::string& fname) {
166 WARNING(
"Saving of ContainerMean objects not supported");
171 #endif // container_hpp Definition: argparse.hpp:39
SaveOption
Enumeration of different options that can be used to save Containers.
Definition: container.hpp:67
Calculate the Mean of a Value over a series of observations.
Definition: container.hpp:144
The namespace containing all filval classes and functions.
Definition: api.hpp:6
A generic value.
Definition: value.hpp:339
Generic, untyped parent class of Container.
Definition: container.hpp:77
virtual T & get_value()=0
Calculate, if necessary, and return the value held by this object.
A class that is used to "hold" values.
Definition: container.hpp:122