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

#include <Tuple.h>

Public Types

typedef T value_type
 
typedef T ValueType
 

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)
 
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 53 of file Tuple.h.

Member Typedef Documentation

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

Definition at line 55 of file Tuple.h.

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

Definition at line 56 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 63 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 66 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 91 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 129 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 133 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 75 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 102 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 110 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 159 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 140 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 122 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 156 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 164 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 58 of file Tuple.h.


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