00001 00011 #ifndef H_TBCI_TRAITS_H 00012 #define H_TBCI_TRAITS_H 00013 00014 #include "basics.h" 00015 00016 NAMESPACE_TBCI 00017 00043 template <typename T> 00044 class tbci_traits NOINST 00045 { 00046 public: 00047 typedef T& refval_type; 00048 typedef const T& const_refval_type; 00049 typedef T& loop_refval_type; 00050 typedef const T& loop_const_refval_type; 00051 }; 00052 00056 #define SPEC_TBCI_TRAITS_ALWAYS_COPY(TYPE) \ 00057 template <> \ 00058 class tbci_traits< TYPE > NOINST \ 00059 { \ 00060 public: \ 00061 typedef TYPE refval_type; \ 00062 typedef TYPE /*const*/ const_refval_type; \ 00063 typedef TYPE loop_refval_type; \ 00064 typedef TYPE /*const*/ loop_const_refval_type; \ 00065 } 00066 00071 #define SPEC_TBCI_TRAITS_LOOP_COPY(TYPE) \ 00072 template <> \ 00073 class tbci_traits< TYPE > NOINST \ 00074 { \ 00075 public: \ 00076 typedef TYPE& refval_type; \ 00077 typedef const TYPE& const_refval_type; \ 00078 typedef TYPE loop_refval_type; \ 00079 typedef TYPE /*const*/ loop_const_refval_type; \ 00080 } 00081 00082 00083 SPEC_TBCI_TRAITS_ALWAYS_COPY(bool); 00084 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned char); 00085 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed short); 00086 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned short); 00087 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed int); 00088 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned int); 00089 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed long); 00090 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned long); 00091 SPEC_TBCI_TRAITS_ALWAYS_COPY(float); 00092 SPEC_TBCI_TRAITS_ALWAYS_COPY(double); 00093 00094 SPEC_TBCI_TRAITS_ALWAYS_COPY(bool*); 00095 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed char*); 00096 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned char*); 00097 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed short*); 00098 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned short*); 00099 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed int*); 00100 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned int*); 00101 SPEC_TBCI_TRAITS_ALWAYS_COPY(signed long*); 00102 SPEC_TBCI_TRAITS_ALWAYS_COPY(unsigned long*); 00103 SPEC_TBCI_TRAITS_ALWAYS_COPY(float*); 00104 SPEC_TBCI_TRAITS_ALWAYS_COPY(double*); 00105 00106 SPEC_TBCI_TRAITS_ALWAYS_COPY(void*); 00107 00108 #ifdef HAVE_LONG_DOUBLE 00109 SPEC_TBCI_TRAITS_ALWAYS_COPY(long double); 00110 SPEC_TBCI_TRAITS_ALWAYS_COPY(long double*); 00111 #endif 00112 #ifdef HAVE_LONG_LONG 00113 SPEC_TBCI_TRAITS_ALWAYS_COPY(long long); 00114 SPEC_TBCI_TRAITS_ALWAYS_COPY(long long*); 00115 #endif 00116 // do_vv_comp 00117 SPEC_TBCI_TRAITS_ALWAYS_COPY(volatile long); 00118 00119 NAMESPACE_END 00120 00121 #endif /* H_TBCI_TRAITS_H */
1.5.6