codedBase Class Referenceabstract

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...

Inheritance diagram for codedBase:
[legend]

Public Member Functions

 ClassName ("codedBase")
 Runtime type information. More...
 
 codedBase ()=default
 Construct null. More...
 
virtual ~codedBase ()=default
 Destructor. More...
 

Protected Member Functions

void setCodeContext (const dictionary &dict)
 Set code context from a dictionary. More...
 
void append (const std::string &str)
 Add content to SHA1 hashing. More...
 
void updateLibrary (const word &name, const dynamicCodeContext &context) const
 Update library as required, using the given context. More...
 
void updateLibrary (const word &name, const dictionary &dict) const
 
void updateLibrary (const word &name) const
 
virtual dlLibraryTablelibs () const =0
 Get the loaded dynamic libraries. More...
 
virtual void prepare (dynamicCode &dynCode, const dynamicCodeContext &context) const =0
 Adapt the context for the current object. More...
 
virtual string description () const =0
 
virtual void clearRedirect () const =0
 
virtual const dictionarycodeDict () const =0
 

Static Protected Member Functions

static void writeCodeDict (Ostream &os, const dictionary &dict)
 Write code-dictionary contents. More...
 

Detailed Description

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 segements (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.

Source files

Definition at line 66 of file codedBase.H.

Constructor & Destructor Documentation

◆ codedBase()

codedBase ( )
default

Construct null.

◆ ~codedBase()

virtual ~codedBase ( )
virtualdefault

Destructor.

Member Function Documentation

◆ writeCodeDict()

void writeCodeDict ( Ostream os,
const dictionary dict 
)
staticprotected

Write code-dictionary contents.

Definition at line 80 of file codedBase.C.

References dict.

◆ setCodeContext()

void setCodeContext ( const dictionary dict)
protected

Set code context from a dictionary.

Definition at line 338 of file codedBase.C.

References dict.

Referenced by codedFunctionObject::read().

Here is the caller graph for this function:

◆ append()

void append ( const std::string &  str)
protected

Add content to SHA1 hashing.

Definition at line 344 of file codedBase.C.

Referenced by codedFunctionObject::read().

Here is the caller graph for this function:

◆ updateLibrary() [1/3]

void updateLibrary ( const word name,
const dynamicCodeContext context 
) const
protected

Update library as required, using the given context.

Definition at line 351 of file codedBase.C.

References dynamicCode::checkSecurity(), DetailInfo, dynamicCodeContext::dict(), Foam::endl(), dynamicCode::libraryBaseName(), Foam::name(), dictionary::name(), dynamicCodeContext::sha1(), dictionary::startLineNumber(), and SHA1::str().

Here is the call graph for this function:

◆ updateLibrary() [2/3]

void updateLibrary ( const word name,
const dictionary dict 
) const
protected

Update library as required, using the given code dictionary to use for the context

Definition at line 410 of file codedBase.C.

References dict, and Foam::name().

Here is the call graph for this function:

◆ updateLibrary() [3/3]

void updateLibrary ( const word name) const
protected

Update library as required, using the predefined context or use the codeDict() to generate one

Definition at line 419 of file codedBase.C.

References Foam::name().

Here is the call graph for this function:

◆ libs()

virtual dlLibraryTable& libs ( ) const
protectedpure virtual

Get the loaded dynamic libraries.

Implemented in codedFunctionObject, CodedSource< Type >, and codedPoints0MotionSolver.

◆ prepare()

virtual void prepare ( dynamicCode dynCode,
const dynamicCodeContext context 
) const
protectedpure virtual

Adapt the context for the current object.

Implemented in codedFunctionObject, CodedSource< Type >, and codedPoints0MotionSolver.

◆ description()

virtual string description ( ) const
protectedpure virtual

◆ clearRedirect()

virtual void clearRedirect ( ) const
protectedpure virtual

◆ codeDict()

virtual const dictionary& codeDict ( ) const
protectedpure virtual

◆ ClassName()

ClassName ( "codedBase"  )

Runtime type information.


The documentation for this class was generated from the following files: