1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 A table of dynamically loaded libraries
33 \*---------------------------------------------------------------------------*/
35 #ifndef dlLibraryTable_H
36 #define dlLibraryTable_H
39 #include "DynamicList.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class dlLibraryTable Declaration
48 \*---------------------------------------------------------------------------*/
52 // Private Member Functions
54 DynamicList<void*> libPtrs_;
56 DynamicList<fileName> libNames_;
59 //- Disallow default bitwise copy construct
60 dlLibraryTable(const dlLibraryTable&);
62 //- Disallow default bitwise assignment
63 void operator=(const dlLibraryTable&);
68 // Declare name of the class and its debug switch
69 ClassName("dlLibraryTable");
76 //- Construct from dictionary and name of 'libs' entry giving
77 // the libraries to load
78 dlLibraryTable(const dictionary&, const word&);
87 //- Open the named library, optionally with warnings if problems occur
88 bool open(const fileName& name, const bool verbose = true);
90 //- Close the named library, optionally with warnings if problems occur
91 bool close(const fileName& name, const bool verbose = true);
93 //- Find the handle of the named library
94 void* findLibrary(const fileName& name);
96 //- Open all the libraries listed in the 'libsEntry' entry in the
97 // given dictionary if present
98 bool open(const dictionary&, const word& libsEntry);
100 //- Open all the libraries listed in the 'libsEntry' entry in the
101 // given dictionary if present and check the additions
102 // to the given constructor table
103 template<class TablePtr>
107 const word& libsEntry,
108 const TablePtr& tablePtr
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 } // End namespace Foam
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 # include "dlLibraryTableTemplates.C"
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 // ************************************************************************* //