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
00052 namespace Teuchos {
00053
00054 template<class T>
00055 struct OrdinalTraits {
00056
00058 static inline int unsupportedType() {
00059 #ifndef TEUCHOS_NO_ERROR_REPORTS
00060 cerr << endl << "Teuchos::OrdinalTraits: unsupported ordinal type." << endl;
00061 #endif
00062 return(-1);
00063 }
00064
00066 static inline bool haveMachineParameters() {return(false);};
00067
00069 static inline T zero() {throw(unsupportedType());};
00070
00072 static inline T one() {throw(unsupportedType());};
00073
00075 static inline const char* name() {throw(unsupportedType());};
00076 };
00077
00078 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00079
00080 template<>
00081 struct OrdinalTraits<int> {
00082
00083 static inline bool haveMachineParameters() {return(false);};
00084 static inline int zero() {return(0);};
00085 static inline int one() {return(1);};
00086 static inline const char* name() {return("int");};
00087 };
00088
00089 template<>
00090 struct OrdinalTraits<long int> {
00091
00092 static inline bool haveMachineParameters() {return(false);};
00093 static inline long int zero() {return((long int)0);};
00094 static inline long int one() {return((long int)1);};
00095 static inline const char* name() {return("long int");};
00096 };
00097
00098 #endif
00099
00100 }
00101
00102 #endif // _TEUCHOS_ORDINALTRAITS_HPP_