DGtal  0.9.3beta
Public Types | Static Public Member Functions | Static Public Attributes
DGtal::NumberTraits< uint16_t > Struct Template Reference

#include <DGtal/kernel/NumberTraits.h>

Public Types

typedef TagTrue IsIntegral
 
typedef TagTrue IsBounded
 
typedef TagTrue IsUnsigned
 
typedef TagFalse IsSigned
 
typedef TagTrue IsSpecialized
 
typedef int16_t SignedVersion
 
typedef uint16_t UnsignedVersion
 
typedef uint16_t ReturnType
 
typedef boost::call_traits< uint16_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 isSigned ()
 
static DGtal::int64_t castToInt64_t (const uint16_t &aT)
 
static double castToDouble (const uint16_t &aT)
 
static bool even (ParamType aT)
 
static bool odd (ParamType aT)
 

Static Public Attributes

static const uint16_t ZERO = 0
 
static const uint16_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< uint16_t >

Specialization for DGtal::uint16_t.

Definition at line 181 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 184 of file NumberTraits.h.

Definition at line 183 of file NumberTraits.h.

Definition at line 186 of file NumberTraits.h.

Definition at line 187 of file NumberTraits.h.

Definition at line 185 of file NumberTraits.h.

typedef boost::call_traits<uint16_t>::param_type DGtal::NumberTraits< uint16_t >::ParamType

Definition at line 191 of file NumberTraits.h.

Definition at line 190 of file NumberTraits.h.

Definition at line 188 of file NumberTraits.h.

Definition at line 189 of file NumberTraits.h.

Member Function Documentation

static double DGtal::NumberTraits< uint16_t >::castToDouble ( const uint16_t aT)
inlinestatic

Cast method to double (for I/O or board export uses only).

Definition at line 230 of file NumberTraits.h.

231  {
232  return static_cast<double>(aT);
233  }
static DGtal::int64_t DGtal::NumberTraits< uint16_t >::castToInt64_t ( const uint16_t aT)
inlinestatic

Definition at line 222 of file NumberTraits.h.

223  {
224  return static_cast<DGtal::int64_t>(aT);
225  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< uint16_t >::digits ( )
inlinestatic

Definition at line 210 of file NumberTraits.h.

211  {
212  return boost::integer_traits<uint16_t>::digits;
213  }
static bool DGtal::NumberTraits< uint16_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 238 of file NumberTraits.h.

239  {
240  return ( aT & 1 ) == 0;
241  }
static BoundEnum DGtal::NumberTraits< uint16_t >::isBounded ( )
inlinestatic

Definition at line 214 of file NumberTraits.h.

References DGtal::BOUNDED.

215  {
216  return BOUNDED;
217  }
static SignEnum DGtal::NumberTraits< uint16_t >::isSigned ( )
inlinestatic

Definition at line 218 of file NumberTraits.h.

References DGtal::UNSIGNED.

219  {
220  return UNSIGNED;
221  }
static ReturnType DGtal::NumberTraits< uint16_t >::max ( )
inlinestatic

Definition at line 206 of file NumberTraits.h.

207  {
208  return boost::integer_traits<uint16_t>::const_max;
209  }
static ReturnType DGtal::NumberTraits< uint16_t >::min ( )
inlinestatic

Definition at line 202 of file NumberTraits.h.

203  {
204  return boost::integer_traits<uint16_t>::const_min;
205  }
static bool DGtal::NumberTraits< uint16_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 246 of file NumberTraits.h.

247  {
248  return ( aT & 1 ) != 0;
249  }
static ReturnType DGtal::NumberTraits< uint16_t >::one ( )
inlinestatic

Definition at line 198 of file NumberTraits.h.

199  {
200  return 1;
201  }
static ReturnType DGtal::NumberTraits< uint16_t >::zero ( )
inlinestatic

Definition at line 194 of file NumberTraits.h.

195  {
196  return 0;
197  }

Field Documentation

const uint16_t DGtal::NumberTraits< uint16_t >::ONE = 1
static

Definition at line 193 of file NumberTraits.h.

const uint16_t DGtal::NumberTraits< uint16_t >::ZERO = 0
static

Definition at line 192 of file NumberTraits.h.


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