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 -------------------------------------------------------------------------------
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::CallbackRegistry
28 
29 Description
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 
35 SourceFiles
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 
48 namespace Foam
49 {
50 
51 // Forward declaration of classes
52 
53 template<class CallbackType>
54 class Callback;
55 
56 
57 /*---------------------------------------------------------------------------*\
58  Class CallbackRegistry Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 TemplateName(CallbackRegistry);
62 
63 
64 /*---------------------------------------------------------------------------*\
65  Class CallbackRegistry Declaration
66 \*---------------------------------------------------------------------------*/
67 
68 template<class CallbackType>
69 class CallbackRegistry
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 
83 public:
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 // ************************************************************************* //
Foam::CallbackRegistry
Base class with which callbacks are registered.
Definition: CallbackRegistry.H:68
Foam::CallbackRegistry::~CallbackRegistry
virtual ~CallbackRegistry()
Destructor.
Definition: CallbackRegistry.C:44
UIDLList.H
Intrusive doubly-linked list.
Foam::CallbackRegistry::CallbackRegistry
CallbackRegistry()
Construct null.
Definition: CallbackRegistry.C:34
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Foam::TemplateName
TemplateName(blendedSchemeBase)
CallbackRegistry.C
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::UILList
Template class for intrusive linked lists.
Definition: UILList.H:52