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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::PtrDictionary
28 
29 Description
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 SourceFiles
36  PtrDictionary.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef PtrDictionary_H
41 #define PtrDictionary_H
42 
43 #include "DictionaryBase.H"
44 #include "DLPtrList.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class PtrDictionary Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class T>
56 class PtrDictionary
57 :
58  public DictionaryBase<DLPtrList<T>, T>
59 {
60 
61 public:
62 
63  // Constructors
64 
65  //- Construct given initial table size
66  PtrDictionary(const label size = 128);
67 
68  //- Copy construct
70 
71  //- Construct from Istream using given Istream constructor class
72  template<class INew>
73  PtrDictionary(Istream& is, const INew& inew);
74 
75  //- Construct from Istream
77 
78 
79  // Member operators
80 
81  //- Find and return entry
82  const T& operator[](const word& key) const
83  {
85  }
86 
87  //- Find and return entry
88  T& operator[](const word& key)
89  {
91  }
92 };
93 
94 
95 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 
97 } // End namespace Foam
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 #ifdef NoRepository
102  #include "PtrDictionary.C"
103 #endif
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 #endif
108 
109 // ************************************************************************* //
Foam::PtrDictionary::PtrDictionary
PtrDictionary(const label size=128)
Construct given initial table size.
Definition: PtrDictionary.C:33
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::PtrDictionary
Template dictionary class which manages the storage associated with it.
Definition: PtrDictionary.H:55
Foam::glTF::key
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:108
DLPtrList.H
Non-intrusive doubly-linked pointer list.
Foam::PtrDictionary::operator[]
const T & operator[](const word &key) const
Find and return entry.
Definition: PtrDictionary.H:81
Foam::INew
A helper class when constructing from an Istream or dictionary.
Definition: INew.H:51
Foam::DictionaryBase< DLPtrList< T >, T >::operator
friend Ostream & operator(Ostream &, const DictionaryBase< DLPtrList< T >, T > &)
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
PtrDictionary.C
dict
dictionary dict
Definition: searchingEngine.H:14
DictionaryBase.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::PtrDictionary::operator[]
T & operator[](const word &key)
Find and return entry.
Definition: PtrDictionary.H:87
Foam::DictionaryBase
Base dictionary class templated on both the form of doubly-linked list it uses as well as the type it...
Definition: DictionaryBase.H:64