CallbackRegistry.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::CallbackRegistry
28
29Description
30 Base class with which callbacks are registered.
31
32 Derive from this class and extend by adding the appropriate callback
33 functions that loop and call the callback functions for each entry.
34
35SourceFiles
36 CallbackRegistry.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef CallbackRegistry_H
41#define CallbackRegistry_H
42
43#include "UIDLList.H"
44#include "className.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51// Forward declaration of classes
52
53template<class CallbackType>
54class Callback;
55
56
57/*---------------------------------------------------------------------------*\
58 Class CallbackRegistry Declaration
59\*---------------------------------------------------------------------------*/
62
63
64/*---------------------------------------------------------------------------*\
65 Class CallbackRegistry Declaration
66\*---------------------------------------------------------------------------*/
67
68template<class CallbackType>
70:
71 public CallbackRegistryName,
72 public UIDLList<CallbackType>
73{
74 // Private Member Functions
75
76 //- No copy construct
77 CallbackRegistry(const CallbackRegistry&) = delete;
78
79 //- No copy assignment
80 void operator=(const CallbackRegistry&) = delete;
81
82
83public:
84
85 // Constructors
86
87 //- Construct null
89
90
91 //- Destructor
92 virtual ~CallbackRegistry();
93};
94
95
96// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97
98} // End namespace Foam
99
100// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
101
102#ifdef NoRepository
103 #include "CallbackRegistry.C"
104#endif
105
106// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107
108#endif
109
110// ************************************************************************* //
Intrusive doubly-linked list.
Base class with which callbacks are registered.
CallbackRegistry()
Construct null.
virtual ~CallbackRegistry()
Destructor.
Template class for intrusive linked lists.
Definition: UILList.H:70
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define TemplateName(TemplateNameString)
Add typeName information from argument TypeNameString to a.
Definition: className.H:79
Namespace for OpenFOAM.