SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
 All Classes Namespaces Files Functions Variables Typedefs Groups
Out.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2011-2012 The SkelCL Team as listed in CREDITS.txt *
3  * http://skelcl.uni-muenster.de *
4  * *
5  * This file is part of SkelCL. *
6  * SkelCL is available under multiple licenses. *
7  * The different licenses are subject to terms and condition as provided *
8  * in the files specifying the license. See "LICENSE.txt" for details *
9  * *
10  *****************************************************************************
11  * *
12  * SkelCL is free software: you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation, either version 3 of the License, or *
15  * (at your option) any later version. See "LICENSE-gpl.txt" for details. *
16  * *
17  * SkelCL is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  *****************************************************************************
23  * *
24  * For non-commercial academic use see the license specified in the file *
25  * "LICENSE-academic.txt". *
26  * *
27  *****************************************************************************
28  * *
29  * If you are interested in other licensing models, including a commercial- *
30  * license, please contact the author at michel.steuwer@uni-muenster.de *
31  * *
32  *****************************************************************************/
33 
39 
40 #ifndef OUT_H_
41 #define OUT_H_
42 
43 #include <type_traits>
44 
45 namespace skelcl {
46 
49 template <typename> class Out;
51 
65 template <template <typename> class ContainerType, typename T>
66 class Out<ContainerType<T>> {
67 public:
73  Out<ContainerType<T>>(ContainerType<T>& c)
74  : _container(c)
75  {}
76 
80  ContainerType<T>& container() const
81  {
82  return _container;
83  }
84 private:
85  ContainerType<T>& _container;
86 };
87 
93 template <template <typename> class ContainerType, typename T>
94 Out<ContainerType<T>> out(ContainerType<T>& c)
95 {
96  return Out<ContainerType<T>>(c);
97 }
98 
99 } // namespace skelcl
100 
101 #endif // OUT_H_
Out< ContainerType< T > > out(ContainerType< T > &c)
Helper function to create a Out wrapper object.
Definition: Out.h:94
ContainerType< T > & container() const
Returns a reference to the the wrapped container.
Definition: Out.h:80