1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 \*---------------------------------------------------------------------------*/
31 #include <OpenFOAM/OSspecific.H>
33 #include <OpenFOAM/IOstreams.H>
34 #include <OpenFOAM/IStringStream.H>
35 #include <OpenFOAM/labelList.H>
36 #include <OpenFOAM/DynamicList.H>
37 #include <OpenFOAM/face.H>
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 int main(int argc, char *argv[])
49 List<label> lstC(IStringStream("(1 2 3 4)")());
56 Info<< "lstA: " << lstA << endl;
57 Info<< "lstC: " << lstC << endl;
59 Xfer<List<label> > xA = xferMove(lstA);
60 Xfer<List<label> > xB;
62 List<label> lstB( xA );
64 Info<< "xA: " << xA() << endl;
65 Info<< "xB: " << xB() << endl;
66 Info<< "lstA: " << lstA << endl;
67 Info<< "lstB: " << lstB << endl;
68 Info<< "lstC: " << lstC << endl;
72 Info<< "xA: " << xA() << endl;
73 Info<< "xB: " << xB() << endl;
74 Info<< "lstA: " << lstA << endl;
75 Info<< "lstB: " << lstB << endl;
76 Info<< "lstC: " << lstC << endl;
80 List<label> lstD(xferCopy(lstC));
81 List<label> lstE(xferMove(lstC));
84 List<label> lstF = xferCopy(lstC);
86 Info<< "xA: " << xA() << endl;
87 Info<< "xB: " << xB() << endl;
88 Info<< "lstA: " << lstA << endl;
89 Info<< "lstB: " << lstB << endl;
90 Info<< "lstC: " << lstC << endl;
91 Info<< "lstD: " << lstD << endl;
92 Info<< "lstE: " << lstE << endl;
93 Info<< "lstF: " << lstF << endl;
95 Info<< "xB[" << xB->size() << "]\n";
97 // clear the underlying List
100 Info<< "xB[" << xB->size() << "]\n";
102 DynamicList<label> dl(10);
103 for (label i = 0; i < 5; i++)
109 face f2(xferCopy<labelList>(dl));
111 Info<< "dl[" << dl.size() << "/" << dl.capacity() << "] " << dl << endl;
112 Info<< "f1: " << f1 << endl;
113 Info<< "f2: " << f2 << endl;
115 // note: xfer() method returns a plain labelList
116 face f3( dl.xfer() );
117 Info<< "dl[" << dl.size() << "/" << dl.capacity() << "] " << dl << endl;
118 Info<< "f3: " << f3 << endl;
124 // ************************ vim: set sw=4 sts=4 et: ************************ //