CVR-Lib last update 20 Sep 2009

cvr::typeInfo< T > Class Template Reference

This class allows to ask some information required in the CVR-Libfor some types. More...

#include <cvrTypeInfo.h>

List of all members.

Public Types

typedef T value_type
typedef T accumulation_type
typedef T square_accumulation_type

Static Public Member Functions

static T suggestedNorm () throw ()
static bool isFloatingPointType () throw ()
static const char * name () throw ()
static T min () throw ()


Detailed Description

template<class T>
class cvr::typeInfo< T >

This class allows to ask some information required in the CVR-Libfor some types.

Note that the members are static, and you do not need any instance of the class to get the type information.

For more information about a type you can also use the std::numeric_limits type of the Standard Template Library.

Example:

 if (typeInfo<dreal>::isFloatingPointType()) {
   cout << "dreal is a floating point type" << endl;
 } else {
   cout << "this is a really weird case!" << endl;
 }

Member Typedef Documentation

template<class T>
typedef T cvr::typeInfo< T >::accumulation_type

Type suggested for accumulation of current type elements (for example int for ubyte).

template<class T>
typedef T cvr::typeInfo< T >::square_accumulation_type

Type suggested to accumulate the square of values of the current type.

template<class T>
typedef T cvr::typeInfo< T >::value_type

Alias for contained type.

For usual C++ types (int, float, etc.), this is exactly as T, but for compound type (complex<T>, point<T>, etc.) this corresponds to the type of the components


Member Function Documentation

template<class T>
static bool cvr::typeInfo< T >::isFloatingPointType (  )  throw () [inline, static]

Return true if the type T is a floating point type.

template<class T>
static T cvr::typeInfo< T >::min (  )  throw () [inline, static]

The difference of this minimum with the std::numeric_limits<T>::min() is that here the minimum value is returned for floating point types and fixed point types.

The STL method returns for floating point values the minimal representable value above zero. For max() you can use the standard version

template<class T>
static const char* cvr::typeInfo< T >::name (  )  throw () [inline, static]

Return a const char* with the name of the type.

template<class T>
static T cvr::typeInfo< T >::suggestedNorm (  )  throw () [inline, static]

Suggest a norm for the given type.

Usually 255 is used for ubyte, 127 for byte, 65535 for all other integer types and 1.0 for the floating point types.


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

Generated on Sun Sep 20 22:09:09 2009 for CVR-Lib by Doxygen 1.5.8