1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011-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/>.
25 Foam::dynamicCodeContext
28 Encapsulation of dynamic code dictionaries
33 \*---------------------------------------------------------------------------*/
35 #ifndef dynamicCodeContext_H
36 #define dynamicCodeContext_H
38 #include "dictionary.H"
39 #include "SHA1Digest.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class dynamicCodeContext Declaration
48 \*---------------------------------------------------------------------------*/
50 class dynamicCodeContext
54 //- The parent dictionary context
55 const dictionary& dict_;
57 //- Mandatory "code" entry
60 //- Optional "localCode" entry
63 //- Optional "codeInclude" entry
66 //- Optional "codeOptions" entry
69 //- Optional "codeLib" entry
72 //- Calculated SHA1Digest
79 //- Construct from a dictionary
80 dynamicCodeContext(const dictionary&);
84 //- Return the parent dictionary context
85 const dictionary& dict() const
90 //- Return the code-includes
91 const string& include() const
96 //- Return the code-options
97 const string& options() const
102 //- Return the code-libs
103 const string& libs() const
109 const string& code() const
114 //- Return the local (file-scope) code
115 const string& localCode() const
120 //- Return SHA1 digest calculated from include, options, code
121 const SHA1Digest& sha1() const
126 //- Helper: add #line directive
127 static void addLineDirective
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 // ************************************************************************* //