HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T > Class Template Reference

#include <Tuple.h>

Public Types

using value_type = T
 
using ValueType = T
 

Public Member Functions

 Tuple ()=default
 
template<int src_size, typename src_valtype >
 Tuple (Tuple< src_size, src_valtype > const &src)
 Conversion constructor. More...
 
template<typename IdxT , typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>
operator[] (IdxT i) const
 
template<typename IdxT , typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>
T & operator[] (IdxT i)
 
operator[] (int i) const
 
T & operator[] (int i)
 
std::string str () const
 
void write (std::ostream &os) const
 
void read (std::istream &is)
 
bool isNan () const
 True if a Nan is present in this tuple. More...
 
bool isInfinite () const
 True if an Inf is present in this tuple. More...
 
bool isFinite () const
 True if no Nan or Inf values are present. More...
 
bool isZero () const
 True if all elements are exactly zero. More...
 
Compatibility

These are mostly for backwards compatibility with functions that take old-style Vs (which are just arrays).

template<typename S >
void toV (S *v) const
 Copies this tuple into an array of a compatible type. More...
 
value_typeasV ()
 Exposes the internal array. Be careful when using this function. More...
 
value_type const * asV () const
 Exposes the internal array. Be careful when using this function. More...
 

Static Public Attributes

static const int size = SIZE
 

Protected Attributes

mm [SIZE]
 

Detailed Description

template<int SIZE, typename T>
class openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >

A base class for homogenous tuple types

Definition at line 30 of file Tuple.h.

Member Typedef Documentation

template<int SIZE, typename T>
using openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::value_type = T

Definition at line 33 of file Tuple.h.

template<int SIZE, typename T>
using openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::ValueType = T

Definition at line 34 of file Tuple.h.

Constructor & Destructor Documentation

template<int SIZE, typename T>
openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::Tuple ( )
default

Trivial constructor, the Tuple is NOT initialized

Note
destructor, copy constructor, assignment operator and move constructor are left to be defined by the compiler (default)
template<int SIZE, typename T>
template<int src_size, typename src_valtype >
openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::Tuple ( Tuple< src_size, src_valtype > const &  src)
inlineexplicit

Conversion constructor.

Tuples with different value types and different sizes can be interconverted using this member. Converting from a larger tuple results in truncation; converting from a smaller tuple results in the extra data members being zeroed out. This function assumes that the integer 0 is convertible to the tuple's value type.

Definition at line 50 of file Tuple.h.

Member Function Documentation

template<int SIZE, typename T>
value_type* openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::asV ( )
inline

Exposes the internal array. Be careful when using this function.

Definition at line 99 of file Tuple.h.

template<int SIZE, typename T>
value_type const* openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::asV ( ) const
inline

Exposes the internal array. Be careful when using this function.

Definition at line 103 of file Tuple.h.

template<int SIZE, typename T>
bool openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::isFinite ( ) const
inline

True if no Nan or Inf values are present.

Definition at line 149 of file Tuple.h.

template<int SIZE, typename T>
bool openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::isInfinite ( ) const
inline

True if an Inf is present in this tuple.

Definition at line 141 of file Tuple.h.

template<int SIZE, typename T>
bool openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::isNan ( ) const
inline

True if a Nan is present in this tuple.

Definition at line 133 of file Tuple.h.

template<int SIZE, typename T>
bool openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::isZero ( ) const
inline

True if all elements are exactly zero.

Definition at line 157 of file Tuple.h.

template<int SIZE, typename T>
template<typename IdxT , typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>
T openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::operator[] ( IdxT  i) const
inline

Definition at line 65 of file Tuple.h.

template<int SIZE, typename T>
template<typename IdxT , typename std::enable_if< std::is_integral< IdxT >::value, bool >::type = true>
T& openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::operator[] ( IdxT  i)
inline

Definition at line 74 of file Tuple.h.

template<int SIZE, typename T>
T openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::operator[] ( int  i) const
inline

Definition at line 83 of file Tuple.h.

template<int SIZE, typename T>
T& openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::operator[] ( int  i)
inline

Definition at line 84 of file Tuple.h.

template<int SIZE, typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::read ( std::istream &  is)
inline

Definition at line 128 of file Tuple.h.

template<int SIZE, typename T>
std::string openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::str ( ) const
inline
Returns
string representation of Classname

Definition at line 109 of file Tuple.h.

template<int SIZE, typename T>
template<typename S >
void openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::toV ( S *  v) const
inline

Copies this tuple into an array of a compatible type.

Definition at line 92 of file Tuple.h.

template<int SIZE, typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::write ( std::ostream &  os) const
inline

Definition at line 125 of file Tuple.h.

Member Data Documentation

template<int SIZE, typename T>
T openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::mm[SIZE]
protected

Definition at line 165 of file Tuple.h.

template<int SIZE, typename T>
const int openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::size = SIZE
static

Definition at line 36 of file Tuple.h.


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