40 template class std::vector<std::vector<float> >;
41 template class std::vector<std::vector<int> >;
45 std::string get_type_name(
const std::type_index& index){
46 std::map<std::type_index, std::string> _map;
48 _map[
typeid(int)]=
"int";
49 _map[
typeid(
unsigned int)]=
"unsigned int";
50 _map[
typeid(float)]=
"float";
51 _map[
typeid(double)]=
"double";
52 _map[
typeid(std::vector<int>)]=
"std::vector<int>";
53 _map[
typeid(std::vector<float>)]=
"std::vector<float>";
54 _map[
typeid(std::map<std::string,std::string>)] =
"std::map<std::string,std::string>";
56 if (_map[index] ==
""){
57 CRITICAL(
"Cannot lookup type name of \"" << index.name() <<
"\"",-1);
83 std::vector<ObsFilter*> filters;
85 virtual void _fill() = 0;
87 GenContainer(
const std::string name,
const std::string& desc)
88 :name(name),desc(desc) { }
94 filters.push_back(dynamic_cast<ObsFilter*>(filter));
99 for (
auto filter : filters){
100 if (!filter->get_value())
return;
105 void set_description(
const std::string& description){
109 const std::string& get_name(){
113 virtual const std::string get_value_name(){
117 virtual GenContainer* clone_as(
const std::string& new_name) = 0;
119 virtual void save_as(
const std::string& fname,
const SaveOption& option) = 0;
121 virtual void save(
const SaveOption& option=SaveOption::PNG) {
122 save_as(get_name(), option);
133 template <
typename H,
typename V>
144 virtual H* get_container(){
148 virtual const std::string get_value_name(){
149 return value->get_name();
161 template <
typename T>
169 sum += this->value->get_value();
174 this->container =
new T();
178 *(this->container) = sum/count;
179 return (this->container);
186 void save_as(
const std::string&) {
187 WARNING(
"Saving of ContainerMean objects not supported");
192 #endif // container_hpp
SaveOption
Enumeration of different options that can be used to save Containers.
Calculate the Mean of a Value over a series of observations.
The namespace containing all filval classes and functions.
Generic, untyped parent class of Container.
A class that is used to "hold" values.