PtrDictionary.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::PtrDictionary
28
29Description
30 Template dictionary class which manages the storage associated with it.
31
32 It is derived from DictionaryBase instantiated on a memory managed form of
33 intrusive doubly-linked list of <T>.
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef Foam_PtrDictionary_H
38#define Foam_PtrDictionary_H
39
40#include "DictionaryBase.H"
41#include "DLPtrList.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class PtrDictionary Declaration
50\*---------------------------------------------------------------------------*/
51
52template<class T>
53class PtrDictionary
54:
55 public DictionaryBase<DLPtrList<T>, T>
56{
57public:
58
59 // Constructors
60
61 //- Construct given initial table size
62 explicit PtrDictionary(const label size = 128)
63 :
65 {}
66
67 //- Copy construct
69 :
71 {}
72
73 //- Construct from Istream using given Istream constructor class
74 template<class INew>
75 PtrDictionary(Istream& is, const INew& inew)
76 :
77 DictionaryBase<DLPtrList<T>, T>(is, inew)
78 {}
79
80 //- Construct from Istream
81 explicit PtrDictionary(Istream& is)
82 :
84 {}
85
86
87 // Member Operators
88
89 //- Find and return entry
90 const T& operator[](const word& key) const
91 {
93 }
94
95 //- Find and return entry
96 T& operator[](const word& key)
97 {
99 }
100};
101
102
103// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104
105} // End namespace Foam
106
107#endif
108
109// ************************************************************************* //
Non-intrusive doubly-linked pointer list.
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it...
friend Ostream & operator(Ostream &, const DictionaryBase< DLPtrList< T >, T > &)
A helper class when constructing from an Istream or dictionary.
Definition: INew.H:52
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Template class for non-intrusive linked PtrLists.
Definition: LPtrList.H:75
Template dictionary class which manages the storage associated with it.
Definition: PtrDictionary.H:55
PtrDictionary(const PtrDictionary &dict)
Copy construct.
Definition: PtrDictionary.H:67
T & operator[](const word &key)
Find and return entry.
Definition: PtrDictionary.H:95
PtrDictionary(Istream &is, const INew &inew)
Construct from Istream using given Istream constructor class.
Definition: PtrDictionary.H:74
const T & operator[](const word &key) const
Find and return entry.
Definition: PtrDictionary.H:89
PtrDictionary(const label size=128)
Construct given initial table size.
Definition: PtrDictionary.H:61
PtrDictionary(Istream &is)
Construct from Istream.
Definition: PtrDictionary.H:80
A class for handling words, derived from Foam::string.
Definition: word.H:68
const volScalarField & T
Namespace for OpenFOAM.
dictionary dict