DynList.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh 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 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "DynList.H"
27 
28 // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
29 
30 // Construct from Istream
31 template<class T, Foam::label staticSize>
33 :
34  dataPtr_(NULL),
35  nAllocated_(0),
36  staticData_(),
37  nextFree_(0)
38 {
40  (
41  "template<class T, Foam::label staticSize>"
42  "\nFoam::DynList<T, staticSize>::DynList(Istream& is)"
43  ) << "Not implemented" << exit(FatalError);
44 }
45 
46 
47 template<class T, Foam::label staticSize>
48 Foam::Ostream& Foam::operator<<
49 (
50  Foam::Ostream& os,
52 )
53 {
54  UList<T> helper(DL.dataPtr_, DL.nextFree_);
55  os << helper;
56 
57  return os;
58 }
59 
60 
61 template<class T, Foam::label staticSize>
62 Foam::Istream& Foam::operator>>
63 (
64  Foam::Istream& is,
66 )
67 {
69  (
70  "template<class T, Foam::label staticSize>"
71  "\nFoam::Istream& Foam::operator>>"
72  "(Foam::Istream& is, Foam::DynList<T, staticSize>& DL)"
73  ) << "Not implemented" << exit(FatalError);
74 
75  UList<T> helper(DL.dataPtr_, DL.nextFree_);
76  //is >> static_cast<List<T>&>(DL);
77  is >> helper;
78  DL.nextFree_ = helper.size();
79 
80  return is;
81 }
82 
83 
84 // ************************************************************************* //
Foam::DynList::DynList
DynList()
Construct null.
Definition: DynListI.H:120
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::FatalError
error FatalError
Foam::DynList
Definition: DynList.H:53
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::UList< T >
FatalErrorIn
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:313
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
DynList.H