|
TECA
The Toolkit for Extreme Climate Analysis
|
The concrete implementation of our type agnostic container for contiguous arrays. More...
#include <teca_variant_array.h>
Public Member Functions | |
| std::string | get_class_name () const override |
| Returns the name of the class in a human readable form. More... | |
| void | initialize () override |
| Initialize all elements with T() More... | |
| const teca_variant_array_impl< T > & | operator= (const teca_variant_array_impl< T > &other) |
| Copy from the other array. More... | |
| template<typename U > | |
| const teca_variant_array_impl< T > & | operator= (const teca_variant_array_impl< U > &other) |
| Copy from the other array. More... | |
| teca_variant_array_impl (teca_variant_array_impl< T > &&other) | |
| Move the contents of the other array. More... | |
| const teca_variant_array_impl< T > & | operator= (teca_variant_array_impl< T > &&other) |
| Move the contents of the other array. More... | |
| T & | get (unsigned long i) |
| Get the ith value. More... | |
| const T & | get (unsigned long i) const |
| Get the ith value. More... | |
| template<typename U > | |
| void | get (unsigned long i, U &val) const |
| Get the ith value. More... | |
| template<typename U > | |
| void | get (size_t start, size_t end, U *vals) const |
| template<typename U > | |
| void | get (std::vector< U > &val) const |
| Copy the data out into the passed in vector. More... | |
| T * | get () |
| Get a pointer to the data. More... | |
| const T * | get () const |
| template<typename U > | |
| void | set (unsigned long i, const U &val) |
| Set the ith value. More... | |
| template<typename U > | |
| void | set (size_t start, size_t end, const U *vals) |
| Set a range of values described by [start end] inclusive. More... | |
| template<typename U > | |
| void | set (const std::vector< U > &val) |
| Copy data, replacing contents with the passed in vector. More... | |
| template<typename U > | |
| void | append (const std::vector< U > &val) |
| Insert from the passed in vector at the back. More... | |
| template<typename U > | |
| void | append (const U &val) |
| virtual unsigned long | size () const noexcept override |
| Get the current size of the data. More... | |
| virtual void | resize (unsigned long n) override |
| Resize the data. More... | |
| void | resize (unsigned long n, const T &val) |
| virtual void | reserve (unsigned long n) override |
| Reserve space. More... | |
| virtual void | clear () noexcept override |
| Clear the data. More... | |
| void | copy (const teca_variant_array &other) |
| void | append (const teca_variant_array &other) |
| void | swap (teca_variant_array &other) override |
| virtual swap More... | |
| bool | equal (const teca_variant_array &other) const override |
| virtual equivalence test More... | |
| int | to_stream (teca_binary_stream &s) const override |
| Serialize to the stream. More... | |
| int | from_stream (teca_binary_stream &s) override |
| Deserialize from the stream. More... | |
| int | to_stream (std::ostream &s) const override |
| Serialize to the stream. More... | |
| int | from_stream (std::ostream &s) override |
| Deserialize from the stream. More... | |
Protected Member Functions | |
| teca_variant_array_impl (unsigned long n) | |
| teca_variant_array_impl (unsigned long n, const T &v) | |
| teca_variant_array_impl (const T *vals, unsigned long n) | |
| template<typename U > | |
| teca_variant_array_impl (const teca_variant_array_impl< U > &other) | |
| teca_variant_array_impl (const teca_variant_array_impl< T > &other) | |
Friends | |
| class | teca_variant_array |
Array constructors | |
| static std::shared_ptr< teca_variant_array_impl< T > > | New () |
| static std::shared_ptr< teca_variant_array_impl< T > > | New (size_t n) |
| static std::shared_ptr< teca_variant_array_impl< T > > | New (size_t n, const T &v) |
| static std::shared_ptr< teca_variant_array_impl< T > > | New (const T *vals, size_t n) |
| std::shared_ptr< teca_variant_array_impl > | shared_from_this () |
| std::shared_ptr< teca_variant_array_impl const > | shared_from_this () const |
| p_teca_variant_array | new_copy () const override |
| Returns a new instance initialized with a copy of this one. More... | |
| p_teca_variant_array | new_copy (size_t start, size_t end) const override |
| Returns a new instance initialized with a copy of a subset of this one. More... | |
| p_teca_variant_array | new_instance () const override |
| Returns a new instance of the same type. More... | |
| p_teca_variant_array | new_instance (size_t n) const override |
| Returns a new instance of the same type sized to hold n elements. More... | |
The concrete implementation of our type agnostic container for contiguous arrays.
| teca_variant_array_impl< T >::teca_variant_array_impl | ( | teca_variant_array_impl< T > && | other | ) |
Move the contents of the other array.
| void teca_variant_array_impl< T >::append | ( | const std::vector< U > & | val | ) |
Insert from the passed in vector at the back.
| void teca_variant_array_impl< T >::append | ( | const teca_variant_array & | other | ) |
append. This method is not virtual so that string can be handled as a special case in the base class.
|
overridevirtualnoexcept |
Clear the data.
| void teca_variant_array_impl< T >::copy | ( | const teca_variant_array & | other | ) |
copy. This method is not virtual so that string can be handled as a special case in the base class.
|
override |
virtual equivalence test
|
inlineoverride |
Deserialize from the stream.
|
inlineoverride |
Deserialize from the stream.
|
inline |
Get a pointer to the data.
| void teca_variant_array_impl< T >::get | ( | std::vector< U > & | val | ) | const |
Copy the data out into the passed in vector.
|
inline |
Get the ith value.
|
inline |
Get the ith value.
| void teca_variant_array_impl< T >::get | ( | unsigned long | i, |
| U & | val | ||
| ) | const |
Get the ith value.
|
override |
Returns the name of the class in a human readable form.
|
override |
Initialize all elements with T()
|
inlinestatic |
Allocate a teca_variant_array_impl < T >
|
inlinestatic |
Allocate a teca_variant_array_impl < T > initialized with n values from vals
|
inlinestatic |
Allocate a teca_variant_array_impl < T > of size n
|
inlinestatic |
Allocate a teca_variant_array_impl < T > of size n initialized with v
|
override |
Returns a new instance initialized with a copy of this one.
|
override |
Returns a new instance initialized with a copy of a subset of this one.
|
override |
Returns a new instance of the same type.
|
override |
Returns a new instance of the same type sized to hold n elements.
| const teca_variant_array_impl< T > & teca_variant_array_impl< T >::operator= | ( | const teca_variant_array_impl< T > & | other | ) |
Copy from the other array.
| const teca_variant_array_impl< T > & teca_variant_array_impl< T >::operator= | ( | const teca_variant_array_impl< U > & | other | ) |
Copy from the other array.
| const teca_variant_array_impl< T > & teca_variant_array_impl< T >::operator= | ( | teca_variant_array_impl< T > && | other | ) |
Move the contents of the other array.
|
overridevirtual |
Reserve space.
|
overridevirtual |
Resize the data.
| void teca_variant_array_impl< T >::set | ( | const std::vector< U > & | val | ) |
Copy data, replacing contents with the passed in vector.
| void teca_variant_array_impl< T >::set | ( | size_t | start, |
| size_t | end, | ||
| const U * | vals | ||
| ) |
Set a range of values described by [start end] inclusive.
| void teca_variant_array_impl< T >::set | ( | unsigned long | i, |
| const U & | val | ||
| ) |
Set the ith value.
|
overridevirtualnoexcept |
Get the current size of the data.
|
override |
virtual swap
|
inlineoverride |
Serialize to the stream.
|
inlineoverride |
Serialize to the stream.