1 /*==========================================================================
2 SeqAn - The Library for Sequence Analysis
4 ============================================================================
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 3 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 ============================================================================
18 $Id: basic_host.h,v 1.1 2008/08/25 16:20:01 langmead Exp $
19 ==========================================================================*/
21 #ifndef SEQAN_HEADER_BASIC_HOST_H
22 #define SEQAN_HEADER_BASIC_HOST_H
24 namespace SEQAN_NAMESPACE_MAIN
26 //////////////////////////////////////////////////////////////////////////////
28 //////////////////////////////////////////////////////////////////////////////
30 //////////////////////////////////////////////////////////////////////////////
31 //these functions assume that the hosted object exports a function "_dataHost"
32 //that returns a reference to a holder type of Host<T>::Type &
34 //////////////////////////////////////////////////////////////////////////////
38 emptyHost(T const & me)
41 return empty(_dataHost(me));
44 //////////////////////////////////////////////////////////////////////////////
48 dependentHost(T const & me)
51 return dependent(_dataHost(me));
54 //////////////////////////////////////////////////////////////////////////////
64 //////////////////////////////////////////////////////////////////////////////
71 create(_dataHost(me));
74 //____________________________________________________________________________
76 template <typename T, typename THost>
82 create(_dataHost(me), host_);
84 template <typename T, typename THost>
90 create(_dataHost(me), host_);
93 //////////////////////////////////////////////////////////////////////////////
95 template <typename T, typename THost>
101 setValue(_dataHost(me), host_);
103 template <typename T, typename THost>
109 setValue(_dataHost(me), host_);
112 //////////////////////////////////////////////////////////////////////////////
114 template <typename T>
115 inline typename Host<T>::Type &
119 return value(_dataHost(me));
121 template <typename T>
122 inline typename Host<T const>::Type &
126 return value(_dataHost(me));
129 //////////////////////////////////////////////////////////////////////////////
131 template <typename T, typename THost>
137 assignValue(_dataHost(me), host_);
139 template <typename T, typename THost>
145 assignValue(_dataHost(me), host_);
147 //////////////////////////////////////////////////////////////////////////////
149 template <typename T, typename THost>
155 moveValue(_dataHost(me), host_);
157 template <typename T, typename THost>
163 moveValue(_dataHost(me), host_);
166 //////////////////////////////////////////////////////////////////////////////
167 } //namespace SEQAN_NAMESPACE_MAIN
169 #endif //#ifndef SEQAN_HEADER_...