simpleObjectRegistry.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2019-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::simpleObjectRegistry
29
30Description
31 Object registry for simpleRegIOobject. Maintains ordering.
32
33SourceFiles
34 simpleObjectRegistry.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef simpleObjectRegistry_H
39#define simpleObjectRegistry_H
40
41#include "Dictionary.H"
42#include "simpleRegIOobject.H"
43#include <string>
44
45// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46
47namespace Foam
48{
49
50// Forward Declarations
51class dictionary;
52
53/*---------------------------------------------------------------------------*\
54 Class simpleObjectRegistryEntry Declaration
55\*---------------------------------------------------------------------------*/
58:
59 public Dictionary<simpleObjectRegistryEntry>::link,
60 public List<simpleRegIOobject*>
61{
62public:
63
64 //- Construct with a single object (list size == 1)
66 :
68 {}
69
70 //- Construct with a List of objects
72 :
74 {}
75};
76
77
78/*---------------------------------------------------------------------------*\
79 Class simpleObjectRegistry Declaration
80\*---------------------------------------------------------------------------*/
83:
84 public Dictionary<simpleObjectRegistryEntry>
85{
86public:
87
88 // Constructors
89
90 //- Construct with given or default (128) table capacity
91 explicit simpleObjectRegistry(const label size = 128)
92 :
94 {}
95
96
97 // Member Functions
98
99 //- Set values (invoke callbacks) from dictionary entries
100 // Reporting honours the infoDetailLevel
101 void setValues(const dictionary& dict, bool report=false);
102
103 //- Set named value, but also handle embedded 'name=value' syntax
104 // Treats 'name=' and 'name' identically.
105 //
106 // Will also accept a floating point value, but the called objects
107 // need to handle that.
108 // Reporting honours the infoDetailLevel
109 void setNamedValue(std::string name, int val, bool report=false);
110
111 //- Deprecated(2021-09) renamed to setNamedValue
112 // \deprecated(2021-09) renamed to setNamedValue
113 void setNamedInt(std::string name, int val, bool report=false)
114 {
115 this->setNamedValue(name, val, report);
116 }
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#endif
127
128// ************************************************************************* //
General purpose template dictionary class that manages the storage associated with it.
Definition: Dictionary.H:60
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:62
simpleObjectRegistryEntry(const List< simpleRegIOobject * > &data)
Construct with a List of objects.
simpleObjectRegistryEntry(simpleRegIOobject *obj)
Construct with a single object (list size == 1)
Object registry for simpleRegIOobject. Maintains ordering.
simpleObjectRegistry(const label size=128)
Construct with given or default (128) table capacity.
void setValues(const dictionary &dict, bool report=false)
Set values (invoke callbacks) from dictionary entries.
void setNamedInt(std::string name, int val, bool report=false)
Deprecated(2021-09) renamed to setNamedValue.
void setNamedValue(std::string name, int val, bool report=false)
Set named value, but also handle embedded 'name=value' syntax.
Abstract base class for registered object with I/O. Used in debug symbol registration.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
dictionary dict