1 #ifndef teca_database_h
2 #define teca_database_h
4 #include "teca_config.h"
5 #include "teca_dataset.h"
6 #include "teca_table.h"
8 #include "teca_table_collection.h"
24 TECA_DATASET_NEW_INSTANCE()
25 TECA_DATASET_NEW_COPY()
30 int append_table(p_teca_table table)
31 {
return this->tables->append(table); }
33 int append_table(
const std::string &name, p_teca_table table)
34 {
return this->tables->append(name, table); }
37 void declare_table(
const std::string &name)
38 { this->tables->declare(name); }
41 void declare_tables(
unsigned int n);
44 unsigned int get_number_of_tables()
const
45 {
return this->tables->size(); }
48 p_teca_table get_table(
unsigned int i)
49 {
return this->tables->get(i); }
51 const_p_teca_table get_table(
unsigned int i)
const
52 {
return this->tables->get(i); }
55 p_teca_table get_table(
const std::string &name)
56 {
return this->tables->get(name); }
58 const_p_teca_table get_table(
const std::string &name)
const
59 {
return this->tables->get(name); }
62 std::string get_table_name(
unsigned int i)
63 {
return this->tables->get_name(i); }
65 const std::string &get_table_name(
unsigned int i)
const
66 {
return this->tables->get_name(i); }
69 int set_table(
const std::string &name, p_teca_table table)
70 {
return this->tables->set(name, table); }
72 int set_table(
unsigned int i, p_teca_table table)
73 {
return this->tables->set(i, table); }
76 int remove_table(
unsigned int i)
77 {
return this->tables->remove(i); }
79 int remove_table(
const std::string &name)
80 {
return this->tables->remove(name); }
83 std::string get_class_name()
const override
84 {
return "teca_database"; }
87 int get_type_code()
const override;
90 bool empty() const noexcept override;
93 void copy(const const_p_teca_dataset &other, allocator alloc) override;
96 void shallow_copy(const p_teca_dataset &other) override;
99 void copy_metadata(const const_p_teca_dataset &other) override;
102 void swap(const p_teca_dataset &other) override;
110 int to_stream(std::ostream &) const override;
111 int from_stream(std::istream &)
override {
return -1; }
122 p_teca_table_collection tables;