00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _TEUCHOS_ORDINALTRAITS_HPP_
00033 #define _TEUCHOS_ORDINALTRAITS_HPP_
00034
00039 #include "Teuchos_ConfigDefs.hpp"
00040
00054
00055
00056
00057 namespace Teuchos {
00058
00059 template<class T>
00060 struct UndefinedOrdinalTraits
00061 {
00063 static inline T notDefined() { return T::this_type_is_missing_a_specialization(); }
00064 };
00065
00066 template<class T>
00067 struct OrdinalTraits {
00068
00070 static const bool hasMachineParameters = false;
00071
00073 static inline T zero() { return UndefinedOrdinalTraits<T>::notDefined(); }
00074
00076 static inline T one() { return UndefinedOrdinalTraits<T>::notDefined(); }
00077
00079 static inline std::string name() { return UndefinedOrdinalTraits<T>::notDefined(); }
00080 };
00081
00082 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00083
00084 template<>
00085 struct OrdinalTraits<char> {
00086
00087 static const bool hasMachineParameters = false;
00088 static inline char zero() {return(0);}
00089 static inline char one() {return(1);}
00090 static inline std::string name() {return("char");}
00091 };
00092
00093 template<>
00094 struct OrdinalTraits<short int> {
00095
00096 static const bool hasMachineParameters = false;
00097 static inline short int zero() {return(0);}
00098 static inline short int one() {return(1);}
00099 static inline std::string name() {return("short int");}
00100 };
00101
00102 template<>
00103 struct OrdinalTraits<int> {
00104
00105 static const bool hasMachineParameters = false;
00106 static inline int zero() {return(0);}
00107 static inline int one() {return(1);}
00108 static inline std::string name() {return("int");}
00109 };
00110
00111 template<>
00112 struct OrdinalTraits<long int> {
00113
00114 static const bool hasMachineParameters = false;
00115 static inline long int zero() {return(static_cast<long int>(0));}
00116 static inline long int one() {return(static_cast<long int>(1));}
00117 static inline std::string name() {return("long int");}
00118 };
00119
00120 #endif
00121
00122 }
00123
00124 #endif // _TEUCHOS_ORDINALTRAITS_HPP_