TECA
The Toolkit for Extreme Climate Analysis
teca_database Class Reference

A collection of named tables. More...

#include <teca_database.h>

Inheritance diagram for teca_database:
[legend]
Collaboration diagram for teca_database:
[legend]

Public Member Functions

std::shared_ptr< teca_databaseshared_from_this ()
 
std::shared_ptr< teca_database const > shared_from_this () const
 
virtual p_teca_dataset new_instance () const override
 virtual constructor. return a new dataset of the same type. More...
 
virtual p_teca_dataset new_copy (allocator alloc=allocator::malloc) const override
 
virtual p_teca_dataset new_shallow_copy () override
 
int append_table (p_teca_table table)
 
int append_table (const std::string &name, p_teca_table table)
 
void declare_table (const std::string &name)
 
void declare_tables (unsigned int n)
 
unsigned int get_number_of_tables () const
 
p_teca_table get_table (unsigned int i)
 
const_p_teca_table get_table (unsigned int i) const
 
p_teca_table get_table (const std::string &name)
 
const_p_teca_table get_table (const std::string &name) const
 
std::string get_table_name (unsigned int i)
 
const std::string & get_table_name (unsigned int i) const
 
int set_table (const std::string &name, p_teca_table table)
 
int set_table (unsigned int i, p_teca_table table)
 
int remove_table (unsigned int i)
 
int remove_table (const std::string &name)
 
std::string get_class_name () const override
 
int get_type_code () const override
 
bool empty () const noexcept override
 
void copy (const const_p_teca_dataset &other, allocator alloc) override
 
void shallow_copy (const p_teca_dataset &other) override
 
void copy_metadata (const const_p_teca_dataset &other) override
 copy metadata. always a deep copy. More...
 
void swap (const p_teca_dataset &other) override
 swap internals of the two objects More...
 
int to_stream (teca_binary_stream &) const override
 serialize the dataset to the given stream for I/O or communication More...
 
int from_stream (teca_binary_stream &) override
 deserialize the dataset from the given stream for I/O or communication More...
 
int to_stream (std::ostream &) const override
 send to stream in a human readable representation More...
 
int from_stream (std::istream &) override
 read from stream in a human readable representation More...
 
- Public Member Functions inherited from teca_dataset
virtual int set_request_indices (const std::string &request_key, const unsigned long ids[2])
 
virtual int get_request_indices (unsigned long ids[2]) const
 
virtual int get_request_index (unsigned long &index) const
 
virtual int set_request_index (const std::string &request_key, unsigned long index)
 
 operator bool () const noexcept
 
virtual teca_metadataget_metadata () noexcept
 get the dataset metadata More...
 
virtual const teca_metadataget_metadata () const noexcept
 get the dataset metadata More...
 
virtual void set_metadata (const teca_metadata &md)
 set the dataset metadata More...
 
void set_index_request_key (const std::vector< std::string > &vals)
 
int get_index_request_key (std::vector< std::string > &vals) const
 
void set_index_request_key (const p_teca_variant_array &vals)
 
int get_index_request_key (p_teca_variant_array vals) const
 
void set_index_request_key (const std::initializer_list< std::string > &l)
 
void set_index_request_key (const std::string *vals)
 
int get_index_request_key (std::string *vals) const
 
void set_index_request_key (const std::string &val_1)
 
int get_index_request_key (std::string &val_1) const
 

Static Public Member Functions

static p_teca_database New ()
 

Additional Inherited Members

- Public Types inherited from teca_dataset
using allocator = teca_variant_array::allocator
 
- Protected Member Functions inherited from teca_dataset
 teca_dataset (const teca_dataset &)=delete
 
 teca_dataset (const teca_dataset &&)=delete
 
void operator= (const p_teca_dataset &other)=delete
 
void operator= (p_teca_dataset &&other)=delete
 
- Protected Attributes inherited from teca_dataset
teca_metadatametadata
 

Detailed Description

A collection of named tables.

A dataset consisting of a collection of named tables. This is a thin wrapper around the teca_table_collection implementing the teca_dataset API.

Member Function Documentation

◆ copy()

void teca_database::copy ( const const_p_teca_dataset &  other,
allocator  alloc 
)
overridevirtual

Deep copy data and metdata.

Parameters
[in]otherThe dataset to copy.
[in]allocThe allocator to use for alloctions of data structures to hold the copy. The default is a CPU based allocator.

Reimplemented from teca_dataset.

◆ copy_metadata()

void teca_database::copy_metadata ( const const_p_teca_dataset &  other)
overridevirtual

copy metadata. always a deep copy.

Reimplemented from teca_dataset.

◆ empty()

bool teca_database::empty ( ) const
overridevirtualnoexcept
Returns
true if the dataset is empty.

Reimplemented from teca_dataset.

◆ from_stream() [1/2]

int teca_database::from_stream ( std::istream &  )
inlineoverridevirtual

read from stream in a human readable representation

Reimplemented from teca_dataset.

◆ from_stream() [2/2]

int teca_database::from_stream ( teca_binary_stream )
overridevirtual

deserialize the dataset from the given stream for I/O or communication

Reimplemented from teca_dataset.

◆ new_copy()

virtual p_teca_dataset teca_database::new_copy ( allocator  alloc = allocator::malloc) const
inlineoverridevirtual

Implements teca_dataset.

◆ new_instance()

virtual p_teca_dataset teca_database::new_instance ( ) const
inlineoverridevirtual

virtual constructor. return a new dataset of the same type.

Implements teca_dataset.

◆ new_shallow_copy()

virtual p_teca_dataset teca_database::new_shallow_copy ( )
inlineoverridevirtual

Virtual shallow copy constructor. return a shallow copy of this dataset in a new instance. References to source data structures are taken, but metadata is always deep copied.

Implements teca_dataset.

◆ shallow_copy()

void teca_database::shallow_copy ( const p_teca_dataset &  other)
overridevirtual

Shallow copy data and metadata. The shallow copy takes references to the source data structures. Metadata is always deep copied.

Parameters
[in]otherThe dataset to copy.

Reimplemented from teca_dataset.

◆ swap()

void teca_database::swap ( const p_teca_dataset &  other)
overridevirtual

swap internals of the two objects

Reimplemented from teca_dataset.

◆ to_stream() [1/2]

int teca_database::to_stream ( std::ostream &  ) const
overridevirtual

send to stream in a human readable representation

Reimplemented from teca_dataset.

◆ to_stream() [2/2]

int teca_database::to_stream ( teca_binary_stream ) const
overridevirtual

serialize the dataset to the given stream for I/O or communication

Reimplemented from teca_dataset.


The documentation for this class was generated from the following file: