|
TECA
The Toolkit for Extreme Climate Analysis
|
#include "teca_config.h"#include "teca_variant_array.h"#include "teca_common.h"#include "teca_binary_stream.h"#include "teca_bad_cast.h"#include "teca_shared_object.h"#include "teca_variant_array_util.h"#include <hamr_buffer.h>#include <vector>#include <string>#include <sstream>#include <exception>#include <typeinfo>#include <iterator>#include <algorithm>#include <type_traits>#include <utility>#include <limits>Go to the source code of this file.
Classes | |
| class | teca_variant_array_impl< T > |
| The concrete implementation of our type agnostic container for contiguous arrays. More... | |
| struct | teca_variant_array_factory |
| Creates an instance of teca_variant_array_impl<T> where T is determined from the type code. More... | |
Macros | |
| #define | TEMPLATE_DISPATCH_CASE(tt, nt, p, ...) |
| #define | NESTED_TEMPLATE_DISPATCH_CASE(tt, nt, p, i, ...) |
| #define | TEMPLATE_DISPATCH_FP(t, p, ...) |
| Executes the code in body if p is a t<nt> where nt is a floating point type. More... | |
| #define | TEMPLATE_DISPATCH_SI(t, p, ...) |
| Executes the code in body if p is a t<nt> where nt is a signed inetegral type. More... | |
| #define | TEMPLATE_DISPATCH_FP_SI(t, p, ...) |
| Executes the code in body if p is a t<nt> where nt is either a signed integral or floating point type. More... | |
| #define | TEMPLATE_DISPATCH_I(t, p, ...) |
| Executes the code in body if p is a t<nt> where nt is an integral type. More... | |
| #define | TEMPLATE_DISPATCH(t, p, ...) |
| #define | TEMPLATE_DISPATCH_OBJ(t, p, ...) |
| #define | TEMPLATE_DISPATCH_PTR(t, p, ...) |
| #define | NESTED_TEMPLATE_DISPATCH_FP(t, p, i, ...) |
| #define | NESTED_TEMPLATE_DISPATCH_I(t, p, i, ...) |
| #define | NESTED_TEMPLATE_DISPATCH(t, p, i, ...) |
| #define | NESTED_VARIANT_ARRAY_DISPATCH(p, i, ...) NESTED_TEMPLATE_DISPATCH(teca_variant_array_impl, p, i, __VA_ARGS__) |
| #define | NESTED_VARIANT_ARRAY_DISPATCH_FP(p, i, ...) NESTED_TEMPLATE_DISPATCH_FP(teca_variant_array_impl, p, i, __VA_ARGS__) |
| #define | NESTED_VARIANT_ARRAY_DISPATCH_I(p, i, ...) NESTED_TEMPLATE_DISPATCH_I(teca_variant_array_impl, p, i, __VA_ARGS__) |
| #define | NESTED_VARIANT_ARRAY_DISPATCH_CASE(nt, p, i, ...) TEMPLATE_DISPATCH_CASE(teca_variant_array_impl, nt, p, i, __VA_ARGS__) |
| #define | VARIANT_ARRAY_DISPATCH(p, ...) TEMPLATE_DISPATCH(teca_variant_array_impl, p, __VA_ARGS__) |
| #define | VARIANT_ARRAY_DISPATCH_FP(p, ...) TEMPLATE_DISPATCH_FP(teca_variant_array_impl, p, __VA_ARGS__) |
| #define | VARIANT_ARRAY_DISPATCH_I(p, ...) TEMPLATE_DISPATCH_I(teca_variant_array_impl, p, __VA_ARGS__) |
| #define | VARIANT_ARRAY_DISPATCH_FP_SI(p, ...) TEMPLATE_DISPATCH_FP_SI(teca_variant_array_impl, p, __VA_ARGS__) |
| #define | VARIANT_ARRAY_DISPATCH_CASE(nt, p, ...) TEMPLATE_DISPATCH_CASE(teca_variant_array_impl, nt, p, __VA_ARGS__) |
| #define | STR_DELIM(_a, _b) (std::is_same<T, std::string>::value ? _a : _b) |
Typedefs | |
| template<typename T > | |
| using | p_teca_variant_array_impl = std::shared_ptr< teca_variant_array_impl< T > > |
| template<typename T > | |
| using | const_p_teca_variant_array_impl = std::shared_ptr< const teca_variant_array_impl< T > > |
| using | teca_string_array = teca_variant_array_impl< std::string > |
| using | p_teca_string_array = std::shared_ptr< teca_variant_array_impl< std::string > > |
| using | const_p_teca_string_array = std::shared_ptr< const teca_variant_array_impl< std::string > > |
| using | teca_float_array = teca_variant_array_impl< float > |
| using | p_teca_float_array = std::shared_ptr< teca_variant_array_impl< float > > |
| using | const_p_teca_float_array = std::shared_ptr< const teca_variant_array_impl< float > > |
| using | teca_double_array = teca_variant_array_impl< double > |
| using | p_teca_double_array = std::shared_ptr< teca_variant_array_impl< double > > |
| using | const_p_teca_double_array = std::shared_ptr< const teca_variant_array_impl< double > > |
| using | teca_char_array = teca_variant_array_impl< char > |
| using | p_teca_char_array = std::shared_ptr< teca_variant_array_impl< char > > |
| using | const_p_teca_char_array = std::shared_ptr< const teca_variant_array_impl< char > > |
| using | teca_unsigned_char_array = teca_variant_array_impl< unsigned char > |
| using | p_teca_unsigned_char_array = std::shared_ptr< teca_variant_array_impl< unsigned char > > |
| using | const_p_teca_unsigned_char_array = std::shared_ptr< const teca_variant_array_impl< unsigned char > > |
| using | teca_short_array = teca_variant_array_impl< short > |
| using | p_teca_short_array = std::shared_ptr< teca_variant_array_impl< short > > |
| using | const_p_teca_short_array = std::shared_ptr< const teca_variant_array_impl< short > > |
| using | teca_unsigned_short_array = teca_variant_array_impl< unsigned short > |
| using | p_teca_unsigned_short_array = std::shared_ptr< teca_variant_array_impl< unsigned short > > |
| using | const_p_teca_unsigned_short_array = std::shared_ptr< const teca_variant_array_impl< unsigned short > > |
| using | teca_int_array = teca_variant_array_impl< int > |
| using | p_teca_int_array = std::shared_ptr< teca_variant_array_impl< int > > |
| using | const_p_teca_int_array = std::shared_ptr< const teca_variant_array_impl< int > > |
| using | teca_unsigned_int_array = teca_variant_array_impl< unsigned int > |
| using | p_teca_unsigned_int_array = std::shared_ptr< teca_variant_array_impl< unsigned int > > |
| using | const_p_teca_unsigned_int_array = std::shared_ptr< const teca_variant_array_impl< unsigned int > > |
| using | teca_long_array = teca_variant_array_impl< long > |
| using | p_teca_long_array = std::shared_ptr< teca_variant_array_impl< long > > |
| using | const_p_teca_long_array = std::shared_ptr< const teca_variant_array_impl< long > > |
| using | teca_unsigned_long_array = teca_variant_array_impl< unsigned long > |
| using | p_teca_unsigned_long_array = std::shared_ptr< teca_variant_array_impl< unsigned long > > |
| using | const_p_teca_unsigned_long_array = std::shared_ptr< const teca_variant_array_impl< unsigned long > > |
| using | teca_long_long_array = teca_variant_array_impl< long long > |
| using | p_teca_long_long_array = std::shared_ptr< teca_variant_array_impl< long long > > |
| using | const_p_teca_long_long_array = std::shared_ptr< const teca_variant_array_impl< long long > > |
| using | teca_unsigned_long_long_array = teca_variant_array_impl< unsigned long long > |
| using | p_teca_unsigned_long_long_array = std::shared_ptr< teca_variant_array_impl< unsigned long long > > |
| using | const_p_teca_unsigned_long_long_array = std::shared_ptr< const teca_variant_array_impl< unsigned long long > > |
| using | teca_size_t_array = teca_variant_array_impl< size_t > |
| using | p_teca_size_t_array = std::shared_ptr< teca_variant_array_impl< size_t > > |
| using | const_p_teca_size_t_array = std::shared_ptr< const teca_variant_array_impl< size_t > > |
Functions | |
| template<typename T > | |
| const_p_teca_variant_array_impl< T > | const_ptr (const p_teca_variant_array_impl< T > &v) |
| template<typename T > | |
| TECA_EXPORT T | min (const const_p_teca_variant_array_impl< T > &a) |
| template<typename T > | |
| TECA_EXPORT T | min (const p_teca_variant_array_impl< T > &a) |
| template<typename T > | |
| TECA_EXPORT T | max (const const_p_teca_variant_array_impl< T > &a) |
| template<typename T > | |
| TECA_EXPORT T | max (const p_teca_variant_array_impl< T > &a) |
| #define NESTED_TEMPLATE_DISPATCH | ( | t, | |
| p, | |||
| i, | |||
| ... | |||
| ) |
A macro for accessing the typed contents of a teca_variant_array
| t | container type |
| p | pointer to an instance to match on |
| i | an indentifier to use with type aliases |
| body | code to execute on match |
See NESTED_TEMPLATE_DISPATCH_CASE for details.
| #define NESTED_TEMPLATE_DISPATCH_CASE | ( | tt, | |
| nt, | |||
| p, | |||
| i, | |||
| ... | |||
| ) |
Executes the code in body if p is a tt<nt> an idnetifier disambiguates type aliases when nested
| tt | derived container |
| nt | contained type |
| p | base class pointer |
| i | identifier |
| body | the code to execute if the type matches |
The following aliases are provided to know the type within the code to execute.
using NT##i = nt; using CNT##i = const nt; using TT##i = tt<nt>; using CTT##i = const tt<nt>; using PT##i = std::shared_ptr<tt<nt>>; using CPT##i = std::shared_ptr<const tt<nt>>; using SP##i = std::shared_ptr<nt>; using CSP##i = std::shared_ptr<const nt>;
| #define NESTED_TEMPLATE_DISPATCH_FP | ( | t, | |
| p, | |||
| i, | |||
| ... | |||
| ) |
A macro for accessing the floating point typed contents of a teca_variant_array
| t | container type |
| p | pointer to an instance to match on |
| i | an indentifier to use with type aliases |
| body | code to execute on match |
See NESTED_TEMPLATE_DISPATCH_CASE for details.
| #define NESTED_TEMPLATE_DISPATCH_I | ( | t, | |
| p, | |||
| i, | |||
| ... | |||
| ) |
A macro for accessing the inetgral typed contents of a teca_variant_array
| t | container type |
| p | pointer to an instance to match on |
| i | an indentifier to use with type aliases |
| body | code to execute on match |
See NESTED_TEMPLATE_DISPATCH_CASE for details.
| #define NESTED_VARIANT_ARRAY_DISPATCH | ( | p, | |
| i, | |||
| ... | |||
| ) | NESTED_TEMPLATE_DISPATCH(teca_variant_array_impl, p, i, __VA_ARGS__) |
shortcuts for NESTED_TEMPLATE_DISPATCH macros
| #define TEMPLATE_DISPATCH | ( | t, | |
| p, | |||
| ... | |||
| ) |
A macro for accessing the typed contents of a teca_variant_array
| t | container type |
| p | pointer to an instance to match on |
| body | code to execute on match |
See TEMPLATE_DISPATCH_CASE for details.
| #define TEMPLATE_DISPATCH_CASE | ( | tt, | |
| nt, | |||
| p, | |||
| ... | |||
| ) |
Executes the code in body if p is a tt<nt>
| tt | derived container |
| nt | contained type |
| p | base class pointer |
| body | the code to execute if the type matches |
The following aliases are provided to know the type within the code to execute.
using NT = nt; using CNT = const nt; using TT = tt<nt>; using CTT = const tt<nt>; using PT = std::shared_ptr<tt<nt>>; using CPT = std::shared_ptr<const tt<nt>>; using SP = std::shared_ptr<nt>; using CSP = std::shared_ptr<const nt>;
| #define TEMPLATE_DISPATCH_FP | ( | t, | |
| p, | |||
| ... | |||
| ) |
Executes the code in body if p is a t<nt> where nt is a floating point type.
| #define TEMPLATE_DISPATCH_FP_SI | ( | t, | |
| p, | |||
| ... | |||
| ) |
Executes the code in body if p is a t<nt> where nt is either a signed integral or floating point type.
| #define TEMPLATE_DISPATCH_I | ( | t, | |
| p, | |||
| ... | |||
| ) |
Executes the code in body if p is a t<nt> where nt is an integral type.
| #define TEMPLATE_DISPATCH_OBJ | ( | t, | |
| p, | |||
| ... | |||
| ) |
A macro for accessing the typed contents of a teca_variant_array
| t | container type |
| p | pointer to an instance to match on |
| body | code to execute on match |
See TEMPLATE_DISPATCH_CASE for details.
| #define TEMPLATE_DISPATCH_PTR | ( | t, | |
| p, | |||
| ... | |||
| ) |
A macro for accessing the typed contents of a teca_variant_array
| t | container type |
| p | pointer to an instance to match on |
| body | code to execute on match |
See TEMPLATE_DISPATCH_CASE for details.
| #define TEMPLATE_DISPATCH_SI | ( | t, | |
| p, | |||
| ... | |||
| ) |
Executes the code in body if p is a t<nt> where nt is a signed inetegral type.
| #define VARIANT_ARRAY_DISPATCH | ( | p, | |
| ... | |||
| ) | TEMPLATE_DISPATCH(teca_variant_array_impl, p, __VA_ARGS__) |
shortcuts for TEMPLATE_DISPATCH macros
| using const_p_teca_variant_array_impl = std::shared_ptr<const teca_variant_array_impl<T> > |
A shared pointer to a const instance of teca_variant_array_impl
| using p_teca_variant_array_impl = std::shared_ptr<teca_variant_array_impl<T> > |
a shared pointer to an instance of teca_variant_array_impl
| const_p_teca_variant_array_impl<T> const_ptr | ( | const p_teca_variant_array_impl< T > & | v | ) |
convert from a pointer to a non-const type to a pointer to a const type. this is used to help with template deduction, which occurs before implicit conversions are considered.