OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
AppTypeTraits.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 /***************************************************************************
3  *
4  * The IPPL Framework
5  *
6  *
7  * Visit http://people.web.psi.ch/adelmann/ for more details
8  *
9  ***************************************************************************/
10 
11 #ifndef APPTYPE_TRAITS_H
12 #define APPTYPE_TRAITS_H
13 
14 
15 
16 // templated traits struct for general IPPL AppType
17 template <class T>
18 struct AppTypeTraits {
19  typedef typename T::Element_t Element_t;
20  enum { ElemDim = T::ElemDim };
21 };
22 
23 // specialized versions for built-in types
24 #define BUILTIN_APPTYPE_TRAITS(T) \
25 template <> \
26 struct AppTypeTraits< T > { \
27  typedef T Element_t; \
28  enum { ElemDim = 0 }; \
29 };
30 
33 BUILTIN_APPTYPE_TRAITS(unsigned char)
35 BUILTIN_APPTYPE_TRAITS(unsigned short)
39 BUILTIN_APPTYPE_TRAITS(unsigned long)
46 
47 #undef BUILTIN_APPTYPE_TRAITS
48 
49 #endif // APPTYPE_TRAITS_H
50 
51 /***************************************************************************
52  * $RCSfile: AppTypeTraits.h,v $ $Author: adelmann $
53  * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:24 $
54  * IPPL_VERSION_ID: $Id: AppTypeTraits.h,v 1.1.1.1 2003/01/23 07:40:24 adelmann Exp $
55  ***************************************************************************/
56 
#define BUILTIN_APPTYPE_TRAITS(T)
Definition: AppTypeTraits.h:24
MMatrix< m_complex > complex(MMatrix< double > real)
Definition: MMatrix.cpp:396
T::Element_t Element_t
Definition: AppTypeTraits.h:19