DGtal  0.9.4beta
Public Types | Static Public Member Functions | Static Public Attributes
DGtal::NumberTraits< uint8_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 int8_t SignedVersion
 
typedef uint8_t UnsignedVersion
 
typedef uint8_t ReturnType
 
typedef boost::call_traits< uint8_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 uint8_t &aT)
 
static double castToDouble (const uint8_t &aT)
 
static bool even (ParamType aT)
 
static bool odd (ParamType aT)
 

Static Public Attributes

static const uint8_t ZERO = 0
 
static const uint8_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< uint8_t >

Specialization for DGtal::uint8_t.

Definition at line 333 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 336 of file NumberTraits.h.

Definition at line 335 of file NumberTraits.h.

Definition at line 338 of file NumberTraits.h.

Definition at line 339 of file NumberTraits.h.

Definition at line 337 of file NumberTraits.h.

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

Definition at line 343 of file NumberTraits.h.

Definition at line 342 of file NumberTraits.h.

Definition at line 340 of file NumberTraits.h.

Definition at line 341 of file NumberTraits.h.

Member Function Documentation

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

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

Definition at line 382 of file NumberTraits.h.

383  {
384  return static_cast<double>(aT);
385  }
static DGtal::int64_t DGtal::NumberTraits< uint8_t >::castToInt64_t ( const uint8_t aT)
inlinestatic

Definition at line 374 of file NumberTraits.h.

375  {
376  return static_cast<DGtal::int64_t>(aT);
377  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< uint8_t >::digits ( )
inlinestatic

Definition at line 362 of file NumberTraits.h.

363  {
364  return boost::integer_traits<uint8_t>::digits;
365  }
static bool DGtal::NumberTraits< uint8_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 390 of file NumberTraits.h.

391  {
392  return ( aT & 1 ) == 0;
393  }
static BoundEnum DGtal::NumberTraits< uint8_t >::isBounded ( )
inlinestatic

Definition at line 366 of file NumberTraits.h.

References DGtal::BOUNDED.

367  {
368  return BOUNDED;
369  }
static SignEnum DGtal::NumberTraits< uint8_t >::isSigned ( )
inlinestatic

Definition at line 370 of file NumberTraits.h.

References DGtal::UNSIGNED.

371  {
372  return UNSIGNED;
373  }
static ReturnType DGtal::NumberTraits< uint8_t >::max ( )
inlinestatic

Definition at line 358 of file NumberTraits.h.

359  {
360  return boost::integer_traits<uint8_t>::const_max;
361  }
static ReturnType DGtal::NumberTraits< uint8_t >::min ( )
inlinestatic

Definition at line 354 of file NumberTraits.h.

355  {
356  return boost::integer_traits<uint8_t>::const_min;
357  }
static bool DGtal::NumberTraits< uint8_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 398 of file NumberTraits.h.

399  {
400  return ( aT & 1 ) != 0;
401  }
static ReturnType DGtal::NumberTraits< uint8_t >::one ( )
inlinestatic

Definition at line 350 of file NumberTraits.h.

351  {
352  return 1;
353  }
static ReturnType DGtal::NumberTraits< uint8_t >::zero ( )
inlinestatic

Definition at line 346 of file NumberTraits.h.

347  {
348  return 0;
349  }

Field Documentation

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

Definition at line 345 of file NumberTraits.h.

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

Definition at line 344 of file NumberTraits.h.


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