Public Types | Static Public Member Functions | Static Public Attributes

DGtal::IntegerTraits< T > Struct Template Reference

Aim: The traits class for all models of Cinteger. More...

#include <IntegerTraits.h>

Inheritance diagram for DGtal::IntegerTraits< T >:
Inheritance graph
[legend]
Collaboration diagram for DGtal::IntegerTraits< T >:
Collaboration graph
[legend]

Public Types

typedef TagUnknown IsBounded
typedef TagUnknown IsUnsigned
typedef TagFalse IsSpecialized
typedef T SignedVersion
typedef T UnsignedVersion
typedef T ReturnType
typedef boost::call_traits< T >
::param_type 
ParamType

Static Public Member Functions

static ReturnType zero ()
static ReturnType one ()
static ReturnType min ()
static ReturnType max ()
static unsigned int digits ()
static BoundEnum isBounded ()
static SignEnum isUnsigned ()

Static Public Attributes

static const T ZERO = T(0)
static const T ONE = T(1)

Detailed Description

template<typename T>
struct DGtal::IntegerTraits< T >

Aim: The traits class for all models of Cinteger.

Description of template class 'IntegerTraits'

Since CInteger describes the concept Integer, this class is used by models of CIinteger to specialize some definitions related to Integer. For instance it defines whether a given Integer is signed or not and what is signed/unsigned version.


Member Typedef Documentation

template<typename T>
typedef TagUnknown DGtal::IntegerTraits< T >::IsBounded
template<typename T>
typedef TagFalse DGtal::IntegerTraits< T >::IsSpecialized
template<typename T>
typedef TagUnknown DGtal::IntegerTraits< T >::IsUnsigned
template<typename T>
typedef boost::call_traits<T>::param_type DGtal::IntegerTraits< T >::ParamType
template<typename T>
typedef T DGtal::IntegerTraits< T >::ReturnType
template<typename T>
typedef T DGtal::IntegerTraits< T >::SignedVersion
template<typename T>
typedef T DGtal::IntegerTraits< T >::UnsignedVersion

Member Function Documentation

template<typename T>
static unsigned int DGtal::IntegerTraits< T >::digits (  )  [static]
Returns:
the number of significant digits for this integer type, or 0 if unbounded or unknown.
template<typename T>
static BoundEnum DGtal::IntegerTraits< T >::isBounded (  )  [static]
Returns:
BOUNDED, UNBOUNDED, or BOUND_UNKNOWN.
template<typename T>
static SignEnum DGtal::IntegerTraits< T >::isUnsigned (  )  [static]
Returns:
SIGNED, UNSIGNED or SIGN_UNKNOWN.
template<typename T>
static ReturnType DGtal::IntegerTraits< T >::max (  )  [static]
Returns:
the maximum possible value for this type of integer or ZERO if not bounded or unknown.
template<typename T>
static ReturnType DGtal::IntegerTraits< T >::min (  )  [static]
Returns:
the minimum possible value for this type of integer or ONE if not bounded or unknown.
template<typename T>
static ReturnType DGtal::IntegerTraits< T >::one (  )  [static]
Returns:
the one of this integer.
template<typename T>
static ReturnType DGtal::IntegerTraits< T >::zero (  )  [static]
Returns:
the zero of this integer.

Field Documentation

template<typename T>
const T DGtal::IntegerTraits< T >::ONE = T(1) [static]

Constant One.

template<typename T>
const T DGtal::IntegerTraits< T >::ZERO = T(0) [static]

Constant Zero.


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