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

Static Public Attributes

static const uint32_t ZERO = 0
 
static const uint32_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< uint32_t >

Specialization for DGtal::uint32_t.

Definition at line 484 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 487 of file NumberTraits.h.

Definition at line 486 of file NumberTraits.h.

Definition at line 489 of file NumberTraits.h.

Definition at line 490 of file NumberTraits.h.

Definition at line 488 of file NumberTraits.h.

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

Definition at line 494 of file NumberTraits.h.

Definition at line 493 of file NumberTraits.h.

Definition at line 491 of file NumberTraits.h.

Definition at line 492 of file NumberTraits.h.

Member Function Documentation

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

Definition at line 529 of file NumberTraits.h.

530  {
531  return static_cast<double>(aT);
532  }
static DGtal::int64_t DGtal::NumberTraits< uint32_t >::castToInt64_t ( const uint32_t aT)
inlinestatic

Definition at line 525 of file NumberTraits.h.

526  {
527  return static_cast<DGtal::int64_t>(aT);
528  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< uint32_t >::digits ( )
inlinestatic

Definition at line 513 of file NumberTraits.h.

514  {
515  return boost::integer_traits<uint32_t>::digits;
516  }
static bool DGtal::NumberTraits< uint32_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 537 of file NumberTraits.h.

538  {
539  return ( aT & 1 ) == 0;
540  }
static BoundEnum DGtal::NumberTraits< uint32_t >::isBounded ( )
inlinestatic

Definition at line 517 of file NumberTraits.h.

References DGtal::BOUNDED.

518  {
519  return BOUNDED;
520  }
static SignEnum DGtal::NumberTraits< uint32_t >::isSigned ( )
inlinestatic

Definition at line 521 of file NumberTraits.h.

References DGtal::UNSIGNED.

522  {
523  return UNSIGNED;
524  }
static ReturnType DGtal::NumberTraits< uint32_t >::max ( )
inlinestatic

Definition at line 509 of file NumberTraits.h.

510  {
511  return boost::integer_traits<uint32_t>::const_max;
512  }
static ReturnType DGtal::NumberTraits< uint32_t >::min ( )
inlinestatic

Definition at line 505 of file NumberTraits.h.

506  {
507  return boost::integer_traits<uint32_t>::const_min;
508  }
static bool DGtal::NumberTraits< uint32_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 545 of file NumberTraits.h.

546  {
547  return ( aT & 1 ) != 0;
548  }
static ReturnType DGtal::NumberTraits< uint32_t >::one ( )
inlinestatic

Definition at line 501 of file NumberTraits.h.

502  {
503  return 1;
504  }
static ReturnType DGtal::NumberTraits< uint32_t >::zero ( )
inlinestatic

Definition at line 497 of file NumberTraits.h.

498  {
499  return 0;
500  }

Field Documentation

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

Definition at line 496 of file NumberTraits.h.

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

Definition at line 495 of file NumberTraits.h.


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