TECA
The Toolkit for Extreme Climate Analysis
teca_table Class Reference

A collection of columnar data with row based accessors and communication and I/O support. More...

#include <teca_table.h>

Inheritance diagram for teca_table:
Collaboration diagram for teca_table:

Public Member Functions

std::shared_ptr< teca_tableshared_from_this ()
 
std::shared_ptr< teca_table const > shared_from_this () const
 
virtual p_teca_dataset new_instance () const override
 
virtual p_teca_dataset new_copy (allocator alloc=allocator::malloc) const override
 
virtual p_teca_dataset new_shallow_copy () override
 
void set_calendar (const std::vector< std::string > &vals)
 
int get_calendar (std::vector< std::string > &vals) const
 
void set_calendar (const p_teca_variant_array &vals)
 
int get_calendar (p_teca_variant_array vals) const
 
void set_calendar (const std::initializer_list< std::string > &l)
 
void set_calendar (const std::string *vals)
 
int get_calendar (std::string *vals) const
 
void set_calendar (const std::string &val_1)
 
int get_calendar (std::string &val_1) const
 
void set_time_units (const std::vector< std::string > &vals)
 
int get_time_units (std::vector< std::string > &vals) const
 
void set_time_units (const p_teca_variant_array &vals)
 
int get_time_units (p_teca_variant_array vals) const
 
void set_time_units (const std::initializer_list< std::string > &l)
 
void set_time_units (const std::string *vals)
 
int get_time_units (std::string *vals) const
 
void set_time_units (const std::string &val_1)
 
int get_time_units (std::string &val_1) const
 
void clear ()
 
template<typename nT , typename cT , typename... oT>
void declare_columns (nT &&col_name, cT col_type, oT &&...args)
 
template<typename nT , typename cT >
void declare_column (nT &&col_name, cT col_type)
 
void set_default_allocator (allocator alloc)
 set the allocator to use with ::declare_column More...
 
unsigned int get_number_of_columns () const noexcept
 
unsigned long get_number_of_rows () const noexcept
 
p_teca_variant_array get_column (unsigned int i)
 
p_teca_variant_array get_column (const std::string &col_name)
 
const_p_teca_variant_array get_column (unsigned int i) const
 
const_p_teca_variant_array get_column (const std::string &col_name) const
 
bool has_column (const std::string &col_name) const
 
std::string get_column_name (unsigned int i) const
 
int append_column (p_teca_variant_array array)
 
int append_column (const std::string &name, p_teca_variant_array array)
 
int remove_column (unsigned int i)
 
int remove_column (const std::string &name)
 
p_teca_array_collection get_columns ()
 
const_p_teca_array_collection get_columns () const
 
void resize (unsigned long n)
 
void reserve (unsigned long n)
 
template<typename cT , typename... oT>
void append (cT &&val, oT &&... args)
 
std::string get_class_name () const override
 
int get_type_code () const override
 
 operator bool () const noexcept
 
bool empty () const noexcept override
 
int to_stream (teca_binary_stream &) const override
 
int from_stream (teca_binary_stream &) override
 
int to_stream (std::ostream &) const override
 
int from_stream (std::istream &) override
 
void copy (const const_p_teca_dataset &other, allocator alloc=allocator::malloc) override
 
void copy (const const_p_teca_table &other, unsigned long first_row, unsigned long last_row, allocator alloc=allocator::malloc)
 deep copy a subset of row values. More...
 
void shallow_copy (const p_teca_dataset &other) override
 
void copy_structure (const const_p_teca_table &other)
 
void swap (const p_teca_dataset &other) override
 
void concatenate_rows (const const_p_teca_table &other)
 
void concatenate_cols (const const_p_teca_table &other, bool deep=false)
 
- Public Member Functions inherited from teca_dataset
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
 
virtual int get_request_index (long &val) const
 
virtual int set_request_index (const std::string &key, long val)
 
virtual int set_request_index (long val)
 
 operator bool () const noexcept
 
virtual void copy_metadata (const const_p_teca_dataset &other)
 
virtual teca_metadataget_metadata () noexcept
 
virtual const teca_metadataget_metadata () const noexcept
 
virtual void set_metadata (const teca_metadata &md)
 

Static Public Member Functions

static p_teca_table New ()
 

Protected Member Functions

 teca_table (const teca_table &other)=delete
 
 teca_table (teca_table &&other)=delete
 
teca_tableoperator= (const teca_table &other)=delete
 
void declare_columns ()
 
void append ()
 
- 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
 

Additional Inherited Members

- Public Types inherited from teca_dataset
using allocator = teca_variant_array::allocator
 
- Protected Attributes inherited from teca_dataset
teca_metadatametadata
 

Detailed Description

A collection of columnar data with row based accessors and communication and I/O support.

Member Function Documentation

◆ copy() [1/2]

void teca_table::copy ( const const_p_teca_dataset &  other,
allocator  alloc = allocator::malloc 
)
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() [2/2]

void teca_table::copy ( const const_p_teca_table &  other,
unsigned long  first_row,
unsigned long  last_row,
allocator  alloc = allocator::malloc 
)

deep copy a subset of row values.

◆ new_copy()

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

Implements teca_dataset.

◆ new_shallow_copy()

virtual p_teca_dataset teca_table::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.

◆ set_default_allocator()

void teca_table::set_default_allocator ( allocator  alloc)
inline

set the allocator to use with ::declare_column

◆ shallow_copy()

void teca_table::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.


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