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

#include <DGtal/kernel/NumberTraits.h>

Public Types

typedef TagTrue IsIntegral
 
typedef TagTrue IsBounded
 
typedef TagFalse IsUnsigned
 
typedef TagTrue IsSigned
 
typedef TagTrue IsSpecialized
 
typedef int8_t SignedVersion
 
typedef uint8_t UnsignedVersion
 
typedef int8_t ReturnType
 
typedef boost::call_traits< int8_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 int8_t &aT)
 
static double castToDouble (const int8_t &aT)
 
static bool even (ParamType aT)
 
static bool odd (ParamType aT)
 

Static Public Attributes

static const int8_t ZERO = 0
 
static const int8_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< int8_t >

Specialization for DGtal::int8_t.

Definition at line 409 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 412 of file NumberTraits.h.

Definition at line 411 of file NumberTraits.h.

Definition at line 414 of file NumberTraits.h.

Definition at line 415 of file NumberTraits.h.

Definition at line 413 of file NumberTraits.h.

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

Definition at line 419 of file NumberTraits.h.

Definition at line 418 of file NumberTraits.h.

Definition at line 416 of file NumberTraits.h.

Definition at line 417 of file NumberTraits.h.

Member Function Documentation

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

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

Definition at line 458 of file NumberTraits.h.

459  {
460  return static_cast<double>(aT);
461  }
static DGtal::int64_t DGtal::NumberTraits< int8_t >::castToInt64_t ( const int8_t aT)
inlinestatic

Definition at line 450 of file NumberTraits.h.

451  {
452  return static_cast<DGtal::int64_t>(aT);
453  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< int8_t >::digits ( )
inlinestatic

Definition at line 438 of file NumberTraits.h.

439  {
440  return boost::integer_traits<int8_t>::digits;
441  }
static bool DGtal::NumberTraits< int8_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 466 of file NumberTraits.h.

467  {
468  return ( aT & 1 ) == 0;
469  }
static BoundEnum DGtal::NumberTraits< int8_t >::isBounded ( )
inlinestatic

Definition at line 442 of file NumberTraits.h.

References DGtal::BOUNDED.

443  {
444  return BOUNDED;
445  }
static SignEnum DGtal::NumberTraits< int8_t >::isSigned ( )
inlinestatic

Definition at line 446 of file NumberTraits.h.

References DGtal::SIGNED.

447  {
448  return SIGNED;
449  }
static ReturnType DGtal::NumberTraits< int8_t >::max ( )
inlinestatic

Definition at line 434 of file NumberTraits.h.

435  {
436  return boost::integer_traits<int8_t>::const_max;
437  }
static ReturnType DGtal::NumberTraits< int8_t >::min ( )
inlinestatic

Definition at line 430 of file NumberTraits.h.

431  {
432  return boost::integer_traits<int8_t>::const_min;
433  }
static bool DGtal::NumberTraits< int8_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 474 of file NumberTraits.h.

475  {
476  return ( aT & 1 ) != 0;
477  }
static ReturnType DGtal::NumberTraits< int8_t >::one ( )
inlinestatic

Definition at line 426 of file NumberTraits.h.

427  {
428  return 1;
429  }
static ReturnType DGtal::NumberTraits< int8_t >::zero ( )
inlinestatic

Definition at line 422 of file NumberTraits.h.

423  {
424  return 0;
425  }

Field Documentation

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

Definition at line 421 of file NumberTraits.h.

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

Definition at line 420 of file NumberTraits.h.


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