|
|
| teca_variant_array (const teca_variant_array &other)=delete |
| |
|
| teca_variant_array (teca_variant_array &&other)=delete |
| |
|
teca_variant_array & | operator= (teca_variant_array &other)=delete |
| |
|
teca_variant_array & | operator= (teca_variant_array &&other)=delete |
| |
| p_teca_variant_array | new_instance () const |
| |
| p_teca_variant_array | new_instance (size_t n) const |
| |
| virtual p_teca_variant_array | new_instance (allocator alloc) const =0 |
| |
| virtual p_teca_variant_array | new_instance (size_t n, allocator alloc) const =0 |
| |
| virtual p_teca_variant_array | new_copy (allocator alloc) const =0 |
| |
| p_teca_variant_array | new_copy () const |
| |
| virtual p_teca_variant_array | new_copy (size_t src_start, size_t n_elem, allocator alloc) const =0 |
| |
| p_teca_variant_array | new_copy (size_t src_start, size_t n_elem) const |
| |
| virtual int | set_allocator (allocator alloc)=0 |
| |
| virtual std::string | get_class_name () const =0 |
| | return the name of the class in a human readable form More...
|
| |
| virtual void | initialize ()=0 |
| | initialize the elements using the default constructor More...
|
| |
| virtual unsigned long | size () const noexcept=0 |
| | get the number of elements in the array More...
|
| |
| virtual void | resize (unsigned long i)=0 |
| | resize. allocates new storage and copies in existing values More...
|
| |
| virtual void | reserve (unsigned long i)=0 |
| |
| virtual void | clear () noexcept=0 |
| | free all the internal data More...
|
| |
| virtual void | swap (const p_teca_variant_array &other)=0 |
| |
| virtual bool | equal (const const_p_teca_variant_array &other) const =0 |
| | compare the two arrays element wize for equality More...
|
| |
| virtual int | to_stream (teca_binary_stream &s) const =0 |
| | serrialize to the binary stream in the internal format More...
|
| |
| virtual int | from_stream (teca_binary_stream &s)=0 |
| | derrialize from the binary stream More...
|
| |
| virtual int | to_stream (std::ostream &s) const =0 |
| | serrialize to the stream in a human readable format More...
|
| |
| virtual int | from_stream (std::ostream &s)=0 |
| | derrialize from the human readable stream More...
|
| |
| virtual unsigned int | type_code () const noexcept=0 |
| | a code for the contained data type used for serialization More...
|
| |
|
Copy the contest of this array to the passed instance. The desitination must be large enough to hold the results. These calls could throw std::bad_cast if the passed in type is not castable to the internal type.
|
| virtual void | get (const p_teca_variant_array &dest) const =0 |
| |
| virtual void | get (size_t src_start, const p_teca_variant_array &dest, size_t dest_start, size_t n_elem) const =0 |
| |
| template<typename T > |
| void | get (unsigned long i, T &val) const |
| | get a single value More...
|
| |
| template<typename T > |
| T | get (unsigned long i) const |
| | get a single value More...
|
| |
| template<typename T > |
| void | get (std::vector< T > &vals) const |
| | get the contents into the passed vector. The vector is resized as needed. More...
|
| |
| template<typename T > |
| void | get (size_t src_start, T *dest, size_t dest_start, size_t n_elem) const |
| | get a subset of the contents into the passed in array. More...
|
| |
|
Assign values to this array form another. This array must already be large enough to hold the result. If automatic resizing is desired use copy instead. These calls could throw std::bad_cast if the passed in type is not castable to the internal type.
|
| virtual void | set (const const_p_teca_variant_array &src)=0 |
| |
| virtual void | set (const p_teca_variant_array &src) |
| | Set from the other array. More...
|
| |
| virtual void | set (size_t dest_start, const const_p_teca_variant_array &src, size_t src_start, size_t n_elem)=0 |
| |
| virtual void | set (size_t dest_start, const p_teca_variant_array &src, size_t src_start, size_t n_elem) |
| |
| template<typename T > |
| void | set (unsigned long i, const T &val) |
| | set a single value More...
|
| |
| template<typename T > |
| void | set (const std::vector< T > &src) |
| | set the contents from a vector of values. this array is not resized. More...
|
| |
| template<typename T > |
| void | set (size_t dest_start, const T *src, size_t src_start, size_t n_elem) |
| | set a subset of the array from a passed array. this array is not resized. More...
|
| |
|
assign the contents of the passed array to this array. This array will be resized to hold the results. These calls could throw std::bad_cast if the passed in type is not castable to the internal type.
|
| virtual void | assign (const const_p_teca_variant_array &src)=0 |
| |
| virtual void | assign (const p_teca_variant_array &src) |
| | assign the contents from the other array. More...
|
| |
| virtual void | assign (const const_p_teca_variant_array &src, size_t src_start, size_t n_elem)=0 |
| | assign a subset of the other array More...
|
| |
| virtual void | assign (const p_teca_variant_array &src, size_t src_start, size_t n_elem) |
| | assign a subset of the other array More...
|
| |
| template<typename T > |
| void | assign (const std::vector< T > &src) |
| | assign the contents from a vector of values. this array is resized as needed. More...
|
| |
| template<typename T > |
| void | assign (const T *src, size_t src_start, size_t n_elem) |
| | assign the contents from a passed array. this array is resized as needed. More...
|
| |
| virtual void | copy (const const_p_teca_variant_array &src) |
| | copy the contents from the other array. More...
|
| |
| virtual void | copy (const p_teca_variant_array &src) |
| | copy the contents from the other array. More...
|
| |
| void | copy (const const_p_teca_variant_array &src, size_t src_start, size_t n_elem) |
| | copy a subset of the other array More...
|
| |
|
Append data at the back of the array. These calls could throw std::bad_cast if the passed in type is not castable to the internal type.
|
| virtual void | append (const const_p_teca_variant_array &src)=0 |
| |
| virtual void | append (const p_teca_variant_array &src) |
| | append the passed array. More...
|
| |
| virtual void | append (const const_p_teca_variant_array &src, size_t src_start, size_t n_elem)=0 |
| | append a subset of the passed array More...
|
| |
| virtual void | append (const p_teca_variant_array &src, size_t src_start, size_t n_elem) |
| | append a subset of the passed array More...
|
| |
| template<typename T > |
| void | append (const T &val) |
| | append a single value. this array is extended as needed. More...
|
| |
| template<typename T > |
| void | append (const std::vector< T > &src) |
| |
| template<typename T > |
| void | append (const T *src, size_t src_start, size_t n_elem) |
| |
A type erasure for array based data.
The variant array supports: set, get, assign, and append. The elements of the array can be stored on different accelerator devices using different technologies and accessed seamless from other accelerator devices and technologies.
Use the type erasure (this class) to implement collections of arrays and public API. Use the concrete implementation (teca_variant_array_impl) for direct access to the typed data.
See TEMPLATE_DISPATCH and NESTED_TEMPLATE_DISPATCH for details on how to apply type specific code to an instance of teca_variant_array.