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<ObsFilter*> filters;
83 virtual void _fill() = 0;
85 GenContainer(
const std::string name,
const std::string& desc)
86 :name(name),desc(desc) { }
92 filters.push_back(dynamic_cast<ObsFilter*>(filter));
97 for (
auto filter : filters){
98 if (!filter->get_value())
return;
103 void set_description(
const std::string& description){
106 const std::string& get_name(){
109 virtual void save_as(
const std::string& fname,
const SaveOption& option) = 0;
110 virtual void save(
const SaveOption& option=SaveOption::PNG) {
111 save_as(get_name(), option);
122 template <
typename H>
127 Container(
const std::string& name, H* container)
129 container(container){ }
130 virtual H* get_container(){
144 template <
typename T>
159 this->container =
new T();
163 *(this->container) = sum/count;
164 return (this->container);
166 void save_as(
const std::string& fname) {
167 WARNING(
"Saving of ContainerMean objects not supported");
172 #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:145
The namespace containing all filval classes and functions.
Definition: api.hpp:6
A generic value.
Definition: value.hpp:352
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:123