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 ctor. Does nothing. More...
 
 Tuple (Tuple const &src)
 Copy constructor. Used when the class signature matches exactly. More...
 
Tupleoperator= (Tuple const &src)
 Assignment operator. More...
 
template<int src_size, typename src_valtype >
 Tuple (Tuple< src_size, src_valtype > const &src)
 Conversion constructor. More...
 
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 compability 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 constasV () 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 55 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 57 of file Tuple.h.

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

Definition at line 58 of file Tuple.h.

Constructor & Destructor Documentation

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

Default ctor. Does nothing.

This is required because declaring a copy (or other) constructor prevents the compiler from synthesizing a default constructor.

Definition at line 65 of file Tuple.h.

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

Copy constructor. Used when the class signature matches exactly.

Definition at line 68 of file Tuple.h.

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 93 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 131 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 135 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 181 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 173 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 165 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 189 of file Tuple.h.

template<int SIZE, typename T>
Tuple& openvdb::OPENVDB_VERSION_NAME::math::Tuple< SIZE, T >::operator= ( Tuple< SIZE, T > const src)
inline

Assignment operator.

This is required because declaring a copy (or other) constructor prevents the compiler from synthesizing a default assignment operator.

Definition at line 77 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 104 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 112 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 160 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 141 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 124 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 157 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 197 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 60 of file Tuple.h.


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