DGtal 1.4.0
Loading...
Searching...
No Matches
DGtal::NumberTraits< T > Struct Template Reference

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

#include <DGtal/kernel/NumberTraits.h>

Inheritance diagram for DGtal::NumberTraits< T >:
[legend]

Additional Inherited Members

- Public Types inherited from DGtal::NumberTraitsImpl< std::decay< T >::type >
typedef TagUnknown IsBounded
 Is the number bounded.
 
typedef TagUnknown IsUnsigned
 Is the number unsigned.
 
typedef TagUnknown IsSigned
 Is the number signed.
 
typedef TagUnknown IsIntegral
 Is the number of integral type.
 
typedef TagFalse IsSpecialized
 Is that a number type with specific traits.
 
typedef T SignedVersion
 Alias to the signed version of the number type.
 
typedef T UnsignedVersion
 Alias to the unsigned version of the number type.
 
typedef T ReturnType
 Alias to the type that should be used as return type.
 
typedef boost::call_traits< T >::param_type ParamType
 Defines a type that represents the "best" way to pass a parameter of type T to a function.
 
- Static Public Member Functions inherited from DGtal::NumberTraitsImpl< std::decay< T >::type >
static ReturnType zero ()
 Return the zero of this integer.
 
static ReturnType one ()
 Return the one of this integer.
 
static ReturnType min ()
 Return the minimum possible value for this type of integer or ONE if not bounded or unknown.
 
static ReturnType max ()
 Return the maximum possible value for this type of integer or ZERO if not bounded or unknown.
 
static unsigned int digits ()
 Return the number of significant binary digits for this integer type, or 0 if unbounded or unknown.
 
static BoundEnum isBounded ()
 Return the bounding type of the number.
 
static SignEnum isSigned ()
 Return the sign type of the number.
 
static DGtal::int64_t castToInt64_t (const T &aT)
 Cast method to DGtal::int64_t (for I/O or board export uses only).
 
static constexpr DGtal::uint64_t castToUInt64_t (const T &aT) noexcept
 Cast method to DGtal::uint64_t (for I/O or board export uses only).
 
static double castToDouble (const T &aT)
 Cast method to double (for I/O or board export uses only).
 
static bool even (ParamType aT)
 Check the parity of a number.
 
static bool odd (ParamType aT)
 Check the parity of a number.
 
- Static Public Attributes inherited from DGtal::NumberTraitsImpl< std::decay< T >::type >
static const T ZERO
 Constant Zero.
 
static const T ONE
 Constant One.
 

Detailed Description

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

Aim: The traits class for all models of Cinteger.

Description of template class 'NumberTraits'

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.

It inherits from NumberTraitsImpl by passing it the given number type without any CV qualifier.

See also
NumberTraitsImpl
Examples
arithmetic/approximation.cpp, and images/exampleConstImageAdapter.cpp.

Definition at line 562 of file NumberTraits.h.


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