Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | Static Public Attributes | List of all members
Teuchos::OrdinalTraits< T > Struct Template Reference

This structure defines some basic traits for the ordinal field type. More...

#include <Teuchos_OrdinalTraits.hpp>

Static Public Member Functions

static T zero ()
 Returns representation of zero for this ordinal type. More...
 
static T one ()
 Returns representation of one for this ordinal type. More...
 
static T max ()
 Returns a value designating the maximum value accessible by code using OrdinalTraits. More...
 
static T invalid ()
 Returns a value designating an invalid number. For signed types, this is typically negative one; for unsigned types, it is typically the largest value. More...
 
static std::string name ()
 Returns name of this ordinal type. More...
 

Static Public Attributes

static const bool hasMachineParameters = false
 Allows testing to see if ordinal traits machine parameters are defined. More...
 

Detailed Description

template<class T>
struct Teuchos::OrdinalTraits< T >

This structure defines some basic traits for the ordinal field type.

Ordinal traits are an essential part of templated codes. This structure offers the basic traits of the templated ordinal type, like defining zero and one.

For the general type, or default implementation, an aborting function is defined which should restrict implementations from using ordinal traits other than the defined specializations.

Note
The defined specializations for OrdinalTraits are: int and long int.

Definition at line 49 of file Teuchos_OrdinalTraits.hpp.

Member Function Documentation

template<class T >
static T Teuchos::OrdinalTraits< T >::zero ( )
inlinestatic

Returns representation of zero for this ordinal type.

Definition at line 55 of file Teuchos_OrdinalTraits.hpp.

template<class T >
static T Teuchos::OrdinalTraits< T >::one ( )
inlinestatic

Returns representation of one for this ordinal type.

Definition at line 58 of file Teuchos_OrdinalTraits.hpp.

template<class T >
static T Teuchos::OrdinalTraits< T >::max ( )
inlinestatic

Returns a value designating the maximum value accessible by code using OrdinalTraits.

For a signed ordinal, this will typically be the maximum positive value. However, for an unsigned ordinal, this will typically be one less than the maximum value, because the maximum value will typically be reserved for designating an invalid value.

Examples:
CommandLineProcessor/cxx_main.cpp.

Definition at line 64 of file Teuchos_OrdinalTraits.hpp.

template<class T >
static T Teuchos::OrdinalTraits< T >::invalid ( )
inlinestatic

Returns a value designating an invalid number. For signed types, this is typically negative one; for unsigned types, it is typically the largest value.

Definition at line 67 of file Teuchos_OrdinalTraits.hpp.

template<class T >
static std::string Teuchos::OrdinalTraits< T >::name ( )
inlinestatic

Returns name of this ordinal type.

Definition at line 70 of file Teuchos_OrdinalTraits.hpp.

Member Data Documentation

template<class T >
const bool Teuchos::OrdinalTraits< T >::hasMachineParameters = false
static

Allows testing to see if ordinal traits machine parameters are defined.

Definition at line 52 of file Teuchos_OrdinalTraits.hpp.


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