1 #ifndef teca_database_h
2 #define teca_database_h
4 #include "teca_dataset.h"
5 #include "teca_table.h"
7 #include "teca_table_collection.h"
23 TECA_DATASET_NEW_INSTANCE()
24 TECA_DATASET_NEW_COPY()
29 int append_table(p_teca_table table)
30 {
return this->tables->append(table); }
32 int append_table(
const std::string &name, p_teca_table table)
33 {
return this->tables->append(name, table); }
36 void declare_table(
const std::string &name)
37 { this->tables->declare(name); }
40 void declare_tables(
unsigned int n);
43 unsigned int get_number_of_tables()
const
44 {
return this->tables->size(); }
47 p_teca_table get_table(
unsigned int i)
48 {
return this->tables->get(i); }
50 const_p_teca_table get_table(
unsigned int i)
const
51 {
return this->tables->get(i); }
54 p_teca_table get_table(
const std::string &name)
55 {
return this->tables->get(name); }
57 const_p_teca_table get_table(
const std::string &name)
const
58 {
return this->tables->get(name); }
61 std::string get_table_name(
unsigned int i)
62 {
return this->tables->get_name(i); }
64 const std::string &get_table_name(
unsigned int i)
const
65 {
return this->tables->get_name(i); }
68 int set_table(
const std::string &name, p_teca_table table)
69 {
return this->tables->set(name, table); }
71 int set_table(
unsigned int i, p_teca_table table)
72 {
return this->tables->set(i, table); }
75 int remove_table(
unsigned int i)
76 {
return this->tables->remove(i); }
78 int remove_table(
const std::string &name)
79 {
return this->tables->remove(name); }
82 std::string get_class_name()
const override
83 {
return "teca_database"; }
86 int get_type_code()
const override;
89 bool empty()
const noexcept
override;
93 void copy(
const const_p_teca_dataset &other)
override;
94 void shallow_copy(
const p_teca_dataset &other)
override;
97 void copy_metadata(
const const_p_teca_dataset &other)
override;
100 void swap(
const p_teca_dataset &other)
override;
108 int to_stream(std::ostream &)
const override;
109 int from_stream(std::istream &)
override {
return -1; }
115 p_teca_table_collection tables;