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

Static Public Attributes

static const int16_t ZERO = 0
 
static const int16_t ONE = 1
 

Detailed Description

template<>
struct DGtal::NumberTraits< int16_t >

Specialization for DGtal::int16_t.

Definition at line 257 of file NumberTraits.h.

Member Typedef Documentation

Definition at line 260 of file NumberTraits.h.

Definition at line 259 of file NumberTraits.h.

Definition at line 262 of file NumberTraits.h.

Definition at line 263 of file NumberTraits.h.

Definition at line 261 of file NumberTraits.h.

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

Definition at line 267 of file NumberTraits.h.

Definition at line 266 of file NumberTraits.h.

Definition at line 264 of file NumberTraits.h.

Definition at line 265 of file NumberTraits.h.

Member Function Documentation

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

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

Definition at line 306 of file NumberTraits.h.

307  {
308  return static_cast<double>(aT);
309  }
static DGtal::int64_t DGtal::NumberTraits< int16_t >::castToInt64_t ( const int16_t aT)
inlinestatic

Definition at line 298 of file NumberTraits.h.

299  {
300  return static_cast<DGtal::int64_t>(aT);
301  }
boost::int64_t int64_t
signed 94-bit integer.
Definition: BasicTypes.h:74
static unsigned int DGtal::NumberTraits< int16_t >::digits ( )
inlinestatic

Definition at line 286 of file NumberTraits.h.

287  {
288  return boost::integer_traits<int16_t>::digits;
289  }
static bool DGtal::NumberTraits< int16_t >::even ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is even.

Definition at line 314 of file NumberTraits.h.

315  {
316  return ( aT & 1 ) == 0;
317  }
static BoundEnum DGtal::NumberTraits< int16_t >::isBounded ( )
inlinestatic

Definition at line 290 of file NumberTraits.h.

References DGtal::BOUNDED.

291  {
292  return BOUNDED;
293  }
static SignEnum DGtal::NumberTraits< int16_t >::isSigned ( )
inlinestatic

Definition at line 294 of file NumberTraits.h.

References DGtal::SIGNED.

295  {
296  return SIGNED;
297  }
static ReturnType DGtal::NumberTraits< int16_t >::max ( )
inlinestatic

Definition at line 282 of file NumberTraits.h.

283  {
284  return boost::integer_traits<int16_t>::const_max;
285  }
static ReturnType DGtal::NumberTraits< int16_t >::min ( )
inlinestatic

Definition at line 278 of file NumberTraits.h.

279  {
280  return boost::integer_traits<int16_t>::const_min;
281  }
static bool DGtal::NumberTraits< int16_t >::odd ( ParamType  aT)
inlinestatic
Parameters
aTany number.
Returns
'true' iff the number is odd.

Definition at line 322 of file NumberTraits.h.

323  {
324  return ( aT & 1 ) != 0;
325  }
static ReturnType DGtal::NumberTraits< int16_t >::one ( )
inlinestatic

Definition at line 274 of file NumberTraits.h.

275  {
276  return 1;
277  }
static ReturnType DGtal::NumberTraits< int16_t >::zero ( )
inlinestatic

Definition at line 270 of file NumberTraits.h.

271  {
272  return 0;
273  }

Field Documentation

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

Definition at line 269 of file NumberTraits.h.

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

Definition at line 268 of file NumberTraits.h.


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