1 #ifndef teca_database_h
2 #define teca_database_h
4 #include "teca_dataset.h"
5 #include "teca_table.h"
6 #include "teca_database_fwd.h"
7 #include "teca_table_collection.h"
21 TECA_DATASET_NEW_INSTANCE()
22 TECA_DATASET_NEW_COPY()
27 int append_table(p_teca_table table)
28 {
return this->tables->append(table); }
30 int append_table(
const std::string &name, p_teca_table table)
31 {
return this->tables->append(name, table); }
34 void declare_table(
const std::string &name)
35 { this->tables->declare(name); }
38 void declare_tables(
unsigned int n);
41 unsigned int get_number_of_tables()
const
42 {
return this->tables->size(); }
45 p_teca_table get_table(
unsigned int i)
46 {
return this->tables->get(i); }
48 const_p_teca_table get_table(
unsigned int i)
const
49 {
return this->tables->get(i); }
52 p_teca_table get_table(
const std::string &name)
53 {
return this->tables->get(name); }
55 const_p_teca_table get_table(
const std::string &name)
const
56 {
return this->tables->get(name); }
59 std::string get_table_name(
unsigned int i)
60 {
return this->tables->get_name(i); }
62 const std::string &get_table_name(
unsigned int i)
const
63 {
return this->tables->get_name(i); }
66 int set_table(
const std::string &name, p_teca_table table)
67 {
return this->tables->set(name, table); }
69 int set_table(
unsigned int i, p_teca_table table)
70 {
return this->tables->set(i, table); }
73 int remove_table(
unsigned int i)
74 {
return this->tables->remove(i); }
76 int remove_table(
const std::string &name)
77 {
return this->tables->remove(name); }
80 std::string get_class_name()
const override
81 {
return "teca_database"; }
84 int get_type_code()
const override;
87 bool empty()
const noexcept
override;
91 void copy(
const const_p_teca_dataset &other)
override;
92 void shallow_copy(
const p_teca_dataset &other)
override;
95 void copy_metadata(
const const_p_teca_dataset &other)
override;
98 void swap(p_teca_dataset &other)
override;
106 int to_stream(std::ostream &)
const override;
107 int from_stream(std::istream &)
override {
return -1; }
113 p_teca_table_collection tables;