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

Static Public Attributes

static const int32_t ZERO = 0
 
static const int32_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< int32_t >

Specialization for DGtal::int32_t.

Definition at line 555 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 558 of file NumberTraits.h.

Definition at line 557 of file NumberTraits.h.

Definition at line 560 of file NumberTraits.h.

Definition at line 561 of file NumberTraits.h.

Definition at line 559 of file NumberTraits.h.

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

Definition at line 565 of file NumberTraits.h.

Definition at line 564 of file NumberTraits.h.

Definition at line 562 of file NumberTraits.h.

Definition at line 563 of file NumberTraits.h.

Member Function Documentation

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

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

Definition at line 604 of file NumberTraits.h.

605  {
606  return static_cast<double>(aT);
607  }
static DGtal::int64_t DGtal::NumberTraits< int32_t >::castToInt64_t ( const int32_t aT)
inlinestatic

Definition at line 596 of file NumberTraits.h.

597  {
598  return static_cast<DGtal::int64_t>(aT);
599  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< int32_t >::digits ( )
inlinestatic

Definition at line 584 of file NumberTraits.h.

585  {
586  return boost::integer_traits<int32_t>::digits;
587  }
static bool DGtal::NumberTraits< int32_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 612 of file NumberTraits.h.

613  {
614  return ( aT & 1 ) == 0;
615  }
static BoundEnum DGtal::NumberTraits< int32_t >::isBounded ( )
inlinestatic

Definition at line 588 of file NumberTraits.h.

References DGtal::BOUNDED.

589  {
590  return BOUNDED;
591  }
static SignEnum DGtal::NumberTraits< int32_t >::isSigned ( )
inlinestatic

Definition at line 592 of file NumberTraits.h.

References DGtal::SIGNED.

593  {
594  return SIGNED;
595  }
static ReturnType DGtal::NumberTraits< int32_t >::max ( )
inlinestatic

Definition at line 580 of file NumberTraits.h.

581  {
582  return boost::integer_traits<int32_t>::const_max;
583  }
static ReturnType DGtal::NumberTraits< int32_t >::min ( )
inlinestatic

Definition at line 576 of file NumberTraits.h.

577  {
578  return boost::integer_traits<int32_t>::const_min;
579  }
static bool DGtal::NumberTraits< int32_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 620 of file NumberTraits.h.

621  {
622  return ( aT & 1 ) != 0;
623  }
static ReturnType DGtal::NumberTraits< int32_t >::one ( )
inlinestatic

Definition at line 572 of file NumberTraits.h.

573  {
574  return 1;
575  }
static ReturnType DGtal::NumberTraits< int32_t >::zero ( )
inlinestatic

Definition at line 568 of file NumberTraits.h.

569  {
570  return 0;
571  }

Field Documentation

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

Definition at line 567 of file NumberTraits.h.

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

Definition at line 566 of file NumberTraits.h.


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