⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 typebuilder.h

📁 cint...昨天看到有个c++解释器,叫CINT,down下来一用,很爽,推荐大家也去看一看。 相信不少朋友们早就知道这个东西了
💻 H
📖 第 1 页 / 共 4 页
字号:
         static Type Get() {            Type t = Type::ByTypeInfo(typeid(T));            if ( t ) return Type( t, VOLATILE | REFERENCE );            else return Type(TypeDistiller<T>::Get(),VOLATILE|REFERENCE);         }      };      /** */      template<typename T> class TypeDistiller<const volatile T &> {      public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(T));            if ( t ) return Type( t, CONST | VOLATILE | REFERENCE );            else return Type(TypeDistiller<T>::Get(),CONST|VOLATILE|REFERENCE);         }      };      /**       * getType will return a reference to a Type (create it if necessery)        * representating the type of the template parameter       * @return reference to Type       */      template < typename T >       const Type& GetType() {         static Type t =  TypeDistiller<T>::Get();         return t;      }      /**        * @struct FuntionDistiller TypeBuilder.h Reflex/Builder/TypeBuilder.h       * @author Pere Mato       * @date 29/07/2004       * @ingroup RefBld       */      template< typename S > class FunctionDistiller;      // This define is necessary for all Sun Forte compilers with version < 5.5 (SunWSpro8)#if ( (defined(__SUNPRO_CC)) && (__SUNPRO_CC<0x550) )#define __R_TN__ typename#else#define __R_TN__#endif      /** */      template< typename R >          class FunctionDistiller<R(void)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(void)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                  std::vector<Type>(),                                                  typeid(R(void)));          }      };      /** */      template < typename R, typename T0 >          class FunctionDistiller<__R_TN__ R(__R_TN__ T0)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                  Tools::MakeVector( TypeDistiller<T0>::Get() ),                                                  typeid(R(T0)));          }      };      /** */      template < typename R, typename T0, typename T1 >          class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1)));            if ( t ) return t;            else return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                              Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                 TypeDistiller<T1>::Get()),                                             typeid(R(T0, T1)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get()),                                                  typeid(R(T0, T1, T2)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2, typename T3 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2,                                              __R_TN__ T3)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2, T3)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get(),                                                                     TypeDistiller<T3>::Get()),                                                  typeid(R(T0, T1, T2, T3)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2, typename T3,         typename T4 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2,                                              __R_TN__ T3, __R_TN__ T4)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2, T3, T4)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get(),                                                                     TypeDistiller<T3>::Get(),                                                                     TypeDistiller<T4>::Get()),                                                  typeid(R(T0, T1, T2, T3, T4)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2, typename T3,         typename T4, typename T5 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2,                                              __R_TN__ T3, __R_TN__ T4, __R_TN__ T5)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2, T3, T4, T5)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get(),                                                                     TypeDistiller<T3>::Get(),                                                                     TypeDistiller<T4>::Get(),                                                                     TypeDistiller<T5>::Get()),                                                  typeid(R(T0, T1, T2, T3, T4, T5)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2, typename T3,         typename T4, typename T5, typename T6 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2,                                              __R_TN__ T3, __R_TN__ T4, __R_TN__ T5,                                              __R_TN__ T6)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2, T3, T4, T5, T6)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get(),                                                                     TypeDistiller<T3>::Get(),                                                                     TypeDistiller<T4>::Get(),                                                                     TypeDistiller<T5>::Get(),                                                                     TypeDistiller<T6>::Get()),                                                  typeid(R(T0, T1, T2, T3, T4, T5, T6)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2, typename T3,         typename T4, typename T5, typename T6, typename T7 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2,                                              __R_TN__ T3, __R_TN__ T4, __R_TN__ T5,                                              __R_TN__ T6, __R_TN__ T7)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2, T3, T4, T5, T6, T7)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get(),                                                                     TypeDistiller<T3>::Get(),                                                                     TypeDistiller<T4>::Get(),                                                                     TypeDistiller<T5>::Get(),                                                                     TypeDistiller<T6>::Get(),                                                                    TypeDistiller<T7>::Get()),                                                  typeid(R( T0, T1, T2, T3, T4, T5, T6, T7)));          }      };      /** */      template < typename R, typename T0, typename T1, typename T2, typename T3,         typename T4, typename T5, typename T6, typename T7,         typename T8 >         class FunctionDistiller<__R_TN__ R(__R_TN__ T0, __R_TN__ T1, __R_TN__ T2,                                              __R_TN__ T3, __R_TN__ T4, __R_TN__ T5,                                              __R_TN__ T6, __R_TN__ T7, __R_TN__ T8)> {         public:         static Type Get() {            Type t = Type::ByTypeInfo(typeid(R(T0, T1, T2, T3, T4, T5, T6, T7, T8)));            if ( t ) return t;            else     return FunctionTypeBuilder( TypeDistiller<R>::Get(),                                                 Tools::MakeVector( TypeDistiller<T0>::Get(),                                                                    TypeDistiller<T1>::Get(),                                                                    TypeDistiller<T2>::Get(),                                                                     TypeDistiller<T3>::Get(),                                                                     TypeDistiller<T4>::Get(),                                                                     TypeDistiller<T5>::Get(),                                                                     TypeDistiller<T6>::Get(),                                                                    TypeDistiller<T7>::Get(),                                                                     TypeDistiller<T8>::Get()),                                                  typeid(R( T0, T1, T2, T3, T4, T5, T6, T7, T8)));         }      };      /** */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -