Base class for function objects and boundary conditions using dynamic code that provides methods for managing loading/unloading/updating of a dynamic library. For these purposes, it uses a dynamicCodeContext object to maintain information about the state. More...
#include <codedBase.H>

Public Member Functions | |
| ClassName ("codedBase") | |
| Runtime type information. | |
| codedBase (const codedBase &)=delete | |
| No copy construct. | |
| void | operator= (const codedBase &)=delete |
| No copy assignment. | |
| codedBase ()=default | |
| Default construct. | |
| virtual | ~codedBase ()=default |
| Destructor. | |
Protected Member Functions | |
| dynamicCodeContext & | codeContext () |
| Access to the dynamic code context. | |
| void | setCodeContext (const dictionary &dict) |
| Set code context from a dictionary. | |
| void | append (const std::string &str) |
| Add content to SHA1 hashing. | |
| void | updateLibrary (const word &name, const dynamicCodeContext &context) const |
| Update library as required, using the given context. | |
| void | updateLibrary (const word &name, const dictionary &dict) const |
| Update library as required, using the given code dictionary to use for the context. | |
| void | updateLibrary (const word &name) const |
| Update library as required, using the predefined context or use the codeDict() to generate one. | |
| virtual dlLibraryTable & | libs () const =0 |
| Mutable access to the loaded dynamic libraries. | |
| virtual string | description () const =0 |
| virtual void | clearRedirect () const =0 |
| virtual const dictionary & | codeDict () const =0 |
| virtual void | prepare (dynamicCode &dynCode, const dynamicCodeContext &context) const =0 |
| Adapt the context for the current object. | |
Static Protected Member Functions | |
| static void | writeCodeDict (Ostream &os, const dictionary &dict) |
| Write code-dictionary contents. | |
| static const dictionary & | codeDict (const objectRegistry &obr, const word &dictName="codeDict") |
| Return "codeDict" from objectRegistry or read from disk. | |
Base class for function objects and boundary conditions using dynamic code that provides methods for managing loading/unloading/updating of a dynamic library. For these purposes, it uses a dynamicCodeContext object to maintain information about the state.
For simple coded objects, the default state management is sufficient. When there are more complicated code segments (eg, functionObjects::codedFunctionObject), the state management must also register these elements as well, starting with an initial setCodeContext() call and followed by append() to register each element.
Definition at line 62 of file codedBase.H.
|
delete |
No copy construct.
References codedBase().
Referenced by codedBase(), CodedField< Type >::CodedField(), CodedField< Type >::CodedField(), codedFixedValueFvPatchField< Type >::codedFixedValueFvPatchField(), codedFixedValueFvPatchField< Type >::codedFixedValueFvPatchField(), codedFixedValueFvPatchField< Type >::codedFixedValueFvPatchField(), codedFixedValueFvPatchField< Type >::codedFixedValueFvPatchField(), codedFixedValueFvPatchField< Type >::codedFixedValueFvPatchField(), codedFixedValuePointPatchField< Type >::codedFixedValuePointPatchField(), codedFixedValuePointPatchField< Type >::codedFixedValuePointPatchField(), codedFixedValuePointPatchField< Type >::codedFixedValuePointPatchField(), codedFixedValuePointPatchField< Type >::codedFixedValuePointPatchField(), codedFixedValuePointPatchField< Type >::codedFixedValuePointPatchField(), CodedFunction1< Type >::CodedFunction1(), CodedFunction1< Type >::CodedFunction1(), codedFunctionObject::codedFunctionObject(), codedMixedFvPatchField< Type >::codedMixedFvPatchField(), codedMixedFvPatchField< Type >::codedMixedFvPatchField(), codedMixedFvPatchField< Type >::codedMixedFvPatchField(), codedMixedFvPatchField< Type >::codedMixedFvPatchField(), codedMixedFvPatchField< Type >::codedMixedFvPatchField(), codedPoints0MotionSolver::codedPoints0MotionSolver(), and operator=().


|
default |
Default construct.
|
virtualdefault |
Destructor.
|
staticprotected |
Write code-dictionary contents.
Definition at line 81 of file codedBase.C.
References dict, os(), and Foam::writeEntryIfPresent().
Referenced by codedFixedValueFvPatchField< Type >::write(), codedFixedValuePointPatchField< Type >::write(), and codedMixedFvPatchField< Type >::write().


|
staticprotected |
Return "codeDict" from objectRegistry or read from disk.
Definition at line 93 of file codedBase.C.
References dictName(), objectRegistry::getObjectPtr(), IOobjectOption::NO_WRITE, IOobjectOption::READ_MODIFIED, IOobjectOption::REGISTER, regIOobject::store(), TimePaths::system(), and objectRegistry::time().
Referenced by codedMixedFvPatchField< Type >::codeDict(), and updateLibrary().


|
inlineprotected |
Access to the dynamic code context.
Definition at line 131 of file codedBase.H.
Referenced by codedFunctionObject::read(), and CodedSource< Type >::read().

|
protected |
Set code context from a dictionary.
Definition at line 270 of file codedBase.C.
References dict.
Referenced by CodedField< Type >::CodedField(), CodedFunction1< Type >::CodedFunction1(), codedFunctionObject::read(), and CodedSource< Type >::read().

|
protected |
Add content to SHA1 hashing.
Definition at line 276 of file codedBase.C.
|
protected |
Update library as required, using the given context.
Definition at line 282 of file codedBase.C.
References dlLibraryTable::basename(), dynamicCode::checkSecurity(), clearRedirect(), dynamicCode::codeName(), description(), DetailInfo, dynamicCodeContext::dict(), Foam::endl(), dynamicCode::libPath(), libs(), loadLibrary(), dictionary::name(), Foam::name(), Foam::returnReduceOr(), dynamicCodeContext::sha1(), dictionary::startLineNumber(), and SHA1::str().
Referenced by CodedSource< Type >::addSup(), CodedSource< Type >::addSup(), CodedField< Type >::CodedField(), CodedFunction1< Type >::CodedFunction1(), codedFunctionObject::codedFunctionObject(), CodedSource< Type >::constrain(), CodedSource< Type >::correct(), codedPoints0MotionSolver::curPoints(), codedFunctionObject::end(), codedFixedValueFvPatchField< Type >::evaluate(), codedFixedValuePointPatchField< Type >::evaluate(), codedMixedFvPatchField< Type >::evaluate(), codedFunctionObject::execute(), CodedField< Type >::integrate(), codedPoints0MotionSolver::movePoints(), codedFunctionObject::read(), codedPoints0MotionSolver::solve(), codedFixedValueFvPatchField< Type >::updateCoeffs(), codedFixedValuePointPatchField< Type >::updateCoeffs(), codedMixedFvPatchField< Type >::updateCoeffs(), updateLibrary(), updateLibrary(), codedPoints0MotionSolver::updateMesh(), CodedFunction1< Type >::value(), CodedField< Type >::value(), and codedFunctionObject::write().


|
protected |
Update library as required, using the given code dictionary to use for the context.
Definition at line 344 of file codedBase.C.
References dict, Foam::name(), and updateLibrary().

|
protected |
Update library as required, using the predefined context or use the codeDict() to generate one.
Definition at line 354 of file codedBase.C.
References codeDict(), Foam::name(), and updateLibrary().

|
protectedpure virtual |
Mutable access to the loaded dynamic libraries.
Implemented in codedMixedFvPatchField< Type >, codedPoints0MotionSolver, CodedFunction1< Type >, codedFunctionObject, CodedSource< Type >, and CodedField< Type >.
Referenced by updateLibrary().

|
protectedpure virtual |
Implemented in codedMixedFvPatchField< Type >, codedPoints0MotionSolver, CodedFunction1< Type >, codedFunctionObject, CodedSource< Type >, and CodedField< Type >.
Referenced by updateLibrary().

|
protectedpure virtual |
Implemented in codedMixedFvPatchField< Type >, codedPoints0MotionSolver, CodedFunction1< Type >, codedFunctionObject, CodedSource< Type >, and CodedField< Type >.
Referenced by updateLibrary().

|
protectedpure virtual |
|
protectedpure virtual |
Adapt the context for the current object.
Implemented in codedMixedFvPatchField< Type >, codedPoints0MotionSolver, CodedFunction1< Type >, codedFunctionObject, CodedSource< Type >, and CodedField< Type >.
| ClassName | ( | "codedBase" | ) |
Runtime type information.
|
delete |