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 void save_as(
const std::string& fname,
const SaveOption& option) = 0;
119 virtual void save(
const SaveOption& option=SaveOption::PNG) {
120 save_as(get_name(), option);
131 template <
typename H,
typename V>
142 virtual H* get_container(){
146 virtual const std::string& get_value_name(){
147 return value->get_name();
159 template <
typename T>
167 sum += this->value->get_value();
172 this->container =
new T();
176 *(this->container) = sum/count;
177 return (this->container);
181 void save_as(
const std::string& fname) {
182 WARNING(
"Saving of ContainerMean objects not supported");
188 #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.