Encapsulation of dynamic code dictionaries and functionality. More...

Public Member Functions | |
| ClassName ("dynamicCode") | |
| dynamicCode (const dictionary &contextDict, const dictionary &codeDict, const word &codeName, const word &codeDirName, const wordList &codeKeys, const wordList &codeDictVars, const word &optionsFileName, const wordList &compileFiles, const wordList ©Files) | |
| Construct from the context and code dictionaries. More... | |
| dynamicCode (const dictionary &contextDict, const word &codeName, const word &codeDirName, const wordList &codeKeys, const wordList &codeDictVars, const word &optionsFileName, const wordList &compileFiles, const wordList ©Files) | |
| Construct from the context dictionary also containing the code. More... | |
| const word & | codeName () const |
| Return the code-name. More... | |
| const word & | codeSha1Name () const |
| Return the unique code name. More... | |
| fileName | libPath () const |
| Library path for specified code name. More... | |
| fileName | libRelPath () const |
| Library path for specified code name relative to $FOAM_CASE. More... | |
| HashTable< string > & | varSubstitutions () |
| bool | upToDate () const |
| Verify if the copied code is up-to-date, based on Make/SHA1Digest. More... | |
| bool | copyOrCreateFiles (const bool verbose=false) const |
| Copy/create files prior to compilation. More... | |
| bool | wmakeLibso () const |
| Compile a libso. More... | |
| void * | loadLibrary (const fileName &libPath) const |
| void | createLibrary (const dictionary &dict, const bool masterOnlyRead=false) const |
| void | read (const dictionary &contextDict, const dictionary &codeDict) |
| void | read (const dictionary &contextDict) |
| void | write (Ostream &os) const |
| Write the code for restart. More... | |
Static Public Member Functions | |
| static word | libraryBaseName (const fileName &libPath) |
| Return the library basename without leading 'lib' or trailing '.so'. More... | |
| static fileName | resolveTemplate (const fileName &templateName) |
| Resolve code-template via Foam::findConfigFile. More... | |
Static Public Attributes | |
| static int | allowSystemOperations |
| Flag if system operations are allowed. More... | |
Encapsulation of dynamic code dictionaries and functionality.
Definition at line 50 of file dynamicCode.H.
| dynamicCode | ( | const dictionary & | contextDict, |
| const dictionary & | codeDict, | ||
| const word & | codeName, | ||
| const word & | codeDirName, | ||
| const wordList & | codeKeys, | ||
| const wordList & | codeDictVars, | ||
| const word & | optionsFileName, | ||
| const wordList & | compileFiles, | ||
| const wordList & | copyFiles | ||
| ) |
Construct from the context and code dictionaries.
and lists of which entries correspond to code
Definition at line 283 of file dynamicCode.C.
References dynamicCode::allowSystemOperations, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::isAdministrator(), Foam::nl, dynamicCode::read(), and SHA1Digest::str().

| dynamicCode | ( | const dictionary & | contextDict, |
| const word & | codeName, | ||
| const word & | codeDirName, | ||
| const wordList & | codeKeys, | ||
| const wordList & | codeDictVars, | ||
| const word & | optionsFileName, | ||
| const wordList & | compileFiles, | ||
| const wordList & | copyFiles | ||
| ) |
Construct from the context dictionary also containing the code.
and lists of which entries correspond
Definition at line 356 of file dynamicCode.C.
| ClassName | ( | "dynamicCode" | ) |
|
inline |
Return the code-name.
Definition at line 226 of file dynamicCode.H.
Referenced by Coded< Type >::Coded().

|
inline |
Return the unique code name.
Definition at line 232 of file dynamicCode.H.
|
inline |
Library path for specified code name.
Corresponds to codeRoot()/libSubDir()/lib<codeSha1Name>.so
Definition at line 239 of file dynamicCode.H.
|
inline |
Library path for specified code name relative to $FOAM_CASE.
Corresponds to dynamicCode/codeDirName()/libSubDir()/lib<codeSha1Name>.so
Definition at line 247 of file dynamicCode.H.
Definition at line 252 of file dynamicCode.H.
Referenced by Coded< DimensionedFieldType >::Coded(), Coded< Type >::Coded(), coded::coded(), codedFixedValueFvPatchField< Type >::codedFixedValueFvPatchField(), codedFixedValuePointPatchField< Type >::codedFixedValuePointPatchField(), codedFunctionObject::codedFunctionObject(), codedFvModel::codedFvModel(), codedMixedFvPatchField< Type >::codedMixedFvPatchField(), and compileTemplate::compileTemplate().

|
static |
Return the library basename without leading 'lib' or trailing '.so'.
Definition at line 472 of file dynamicCode.C.
References fileName::name().
Referenced by codedBase::updateLibrary(), and codedBase::~codedBase().


|
static |
Resolve code-template via Foam::findConfigFile.
Definition at line 480 of file dynamicCode.C.
References Foam::findConfigFile().
Referenced by chemistryModel::New().


| bool upToDate | ( | ) | const |
Verify if the copied code is up-to-date, based on Make/SHA1Digest.
Definition at line 600 of file dynamicCode.C.
References Foam::exists(), and Foam::file.

| bool copyOrCreateFiles | ( | const bool | verbose = false | ) | const |
Copy/create files prior to compilation.
Definition at line 494 of file dynamicCode.C.
References UList< T >::empty(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, forAllConstIter, IOstream::good(), Istream::good(), Foam::Info, Foam::mkDir(), fileName::name(), and Foam::nl.

| bool wmakeLibso | ( | ) | const |
Compile a libso.
Definition at line 585 of file dynamicCode.C.
References Foam::system().

| void * loadLibrary | ( | const fileName & | libPath | ) | const |
Definition at line 613 of file dynamicCode.C.
References Foam::dlOpen(), dlLibraryTable::findLibrary(), Foam::libs, and dlLibraryTable::open().

| void createLibrary | ( | const dictionary & | dict, |
| const bool | masterOnlyRead = false |
||
| ) | const |
Definition at line 629 of file dynamicCode.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, regIOobject::fileModificationSkew, Foam::fileSize(), UPstream::master(), UPstream::myProcNo(), Foam::nl, Foam::Pout, Pstream::scatter(), and Foam::sleep().

| void read | ( | const dictionary & | contextDict, |
| const dictionary & | codeDict | ||
| ) |
Definition at line 385 of file dynamicCode.C.
References OSHA1stream::digest(), forAll, forAllConstIter, Foam::stringOps::inplaceExpandCodeString(), dictionary::lookupEntryPtr(), dictionaryName::name(), word::null, entry::stream(), and Foam::stringOps::trim().
Referenced by dynamicCode::dynamicCode(), codedFunctionObject::read(), and codedFvModel::read().


| void read | ( | const dictionary & | contextDict | ) |
Definition at line 738 of file dynamicCode.C.
References Foam::read().

| void write | ( | Ostream & | os | ) | const |
Write the code for restart.
Definition at line 744 of file dynamicCode.C.
References forAll, verbatimString::null, and Foam::writeEntry().
Referenced by codedFixedValueFvPatchField< Type >::write(), codedMixedFvPatchField< Type >::write(), codedFixedValuePointPatchField< Type >::write(), Coded< DimensionedFieldType >::write(), and Coded< Type >::write().


|
static |
Flag if system operations are allowed.
Definition at line 188 of file dynamicCode.H.
Referenced by dynamicCode::dynamicCode(), chemistryModel::New(), argList::parse(), and systemCall::read().