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_transport.h,v 1.1 2008/08/25 16:20:01 langmead Exp $
19 ==========================================================================*/
21 #ifndef SEQAN_HEADER_BASIC_TRANSPORT_H
22 #define SEQAN_HEADER_BASIC_TRANSPORT_H
24 namespace SEQAN_NAMESPACE_MAIN
27 //////////////////////////////////////////////////////////////////////////////
29 //////////////////////////////////////////////////////////////////////////////
33 ..summary:Assigns one object to another object.
34 ..cat:Content Manipulation
35 ..signature:assign(target, source)
36 ..signature:assign(target, source [, limit] [,resize_tag])
37 ..param.target: Gets the content of $source$.
38 ..param.source: Is copied to $target$.
39 ..param.limit: The maximal length of $target$ after the operation. (optional)
40 ...remarks:This arguments can be applied if $target$ is a container.
41 ..param.resize_tag: Specifies the strategy that is applied if $target$ has not enough capacity to store the complete content. (optional)
42 ...type:Tag.Overflow Strategy
43 ...default:Specified by @Metafunction.DefaultOverflowImplicit@ of the $target$ type.
44 ...remarks:This arguments can be applied if $target$ is a container.
45 ..remarks:$assign(target, source)$ is semantically equivalent to $target = source$.
48 template <typename TTarget, typename TSource>
50 assign(TTarget & target,
56 template <typename TTarget, typename TSource>
58 assign(TTarget & target,
59 TSource const & source)
65 //////////////////////////////////////////////////////////////////////////////
67 template <typename TSpec> struct Proxy;
69 template<typename TTargetSpec, typename TSource>
71 assign(Proxy<TTargetSpec> & target,
75 assignValue(iter(target), source);
78 template<typename TTargetSpec, typename TSource>
80 assign(Proxy<TTargetSpec> & target,
81 TSource const & source)
84 assignValue(iter(target), source);
87 //////////////////////////////////////////////////////////////////////////////
89 //////////////////////////////////////////////////////////////////////////////
93 ..summary:Hands over content from one container to another container.
94 ..cat:Content Manipulation
95 ..signature:move(target, source)
96 ..param.target:A container $source$ is moved to.
97 ..param.source:A container that is moved to $target$.
98 ..remarks:The function tries to hand over the contents of $source$ to $target$.
99 If this is possible, $source$ losts its content and will therefore be empty after this operation.
100 Otherwise, the function behaves like @Function.assign@ and $source$ is copied to $target$.
101 ..see:Function.assign
104 template<typename TTarget, typename TSource>
106 move(TTarget & target,
110 assign(target, source);
112 template<typename TTarget, typename TSource>
114 move(TTarget const & target,
118 assign(target, source);
120 template<typename TTarget, typename TSource>
122 move(TTarget & target,
123 TSource const & source)
126 assign(target, source);
128 template<typename TTarget, typename TSource>
130 move(TTarget const & target,
131 TSource const & source)
134 assign(target, source);
138 //////////////////////////////////////////////////////////////////////////////
140 //////////////////////////////////////////////////////////////////////////////
144 ..summary:Assigns one object to another object avoiding to copy contents.
145 ..cat:Content Manipulation
146 ..signature:assign(target, source)
147 ..signature:assign(target, source)
148 ..param.target: Gets the content of $source$.
149 ..param.source: Content source.
150 ..remarks:$set(target, source)$ is semantically equivalent to $target = source$.
151 If possible, $set$ copies content references instead of the content itself.
154 //TODO: rename set to ...
156 template<typename TTarget, typename TSource>
158 set(TTarget & target,
162 assign(target, source);
164 template<typename TTarget, typename TSource>
166 set(TTarget const & target,
170 assign(target, source);
172 template<typename TTarget, typename TSource>
174 set(TTarget & target,
175 TSource const & source)
178 assign(target, source);
180 template<typename TTarget, typename TSource>
182 set(TTarget const & target,
183 TSource const & source)
186 assign(target, source);
190 //////////////////////////////////////////////////////////////////////////////
192 } //namespace SEQAN_NAMESPACE_MAIN
194 #endif //#ifndef SEQAN_HEADER_...