Encapsulation of dynamic code dictionaries. More...
Public Member Functions | |
dynamicCodeContext () | |
Construct null. More... | |
dynamicCodeContext (const dictionary &dict) | |
Construct from a dictionary. More... | |
bool | valid () const |
Considered valid if not using dictionary::null as the context. More... | |
void | setCodeContext (const dictionary &dict) |
Set code context from a dictionary. More... | |
const dictionary & | dict () const |
Return the parent dictionary context. More... | |
const string & | include () const |
Return the code-includes. More... | |
const string & | options () const |
Return the code-options. More... | |
const string & | libs () const |
Return the code-libs. More... | |
const string & | code () const |
Return the code. More... | |
const string & | localCode () const |
Return the local (file-scope) code. More... | |
const SHA1 & | sha1 () const |
Return SHA1 calculated from options, libs, include, code. More... | |
void | append (const std::string &str) |
Add content to SHA1 hashing. More... | |
operator const dictionary & () const | |
Cast to dictionary. More... | |
Static Public Member Functions | |
static void | inplaceExpand (string &code, const dictionary &dict) |
Cleanup string and expand with dictionary parameters. More... | |
static unsigned | addLineDirective (string &code, label lineNum, const fileName &file) |
Prefix a #line directive to code. More... | |
static unsigned | addLineDirective (string &code, label lineNum, const dictionary &dict) |
Prefix a #line directive to code. More... | |
Encapsulation of dynamic code dictionaries.
Definition at line 53 of file dynamicCodeContext.H.
Construct null.
Definition at line 81 of file dynamicCodeContext.C.
|
explicit |
Construct from a dictionary.
Definition at line 87 of file dynamicCodeContext.C.
References dynamicCodeContext::dict(), and dynamicCodeContext::setCodeContext().
|
static |
Cleanup string and expand with dictionary parameters.
Definition at line 36 of file dynamicCodeContext.C.
References dict, Foam::stringOps::inplaceExpand(), and Foam::stringOps::inplaceTrim().
Referenced by codedFunctionObject::read(), and dynamicCodeContext::setCodeContext().
Prefix a #line directive to code.
The input lineNum is 0-based. Is a no-op if any of the arguments are invalid (lineNum is negative, code or file are empty)
Definition at line 47 of file dynamicCodeContext.C.
References Foam::name().
Referenced by codedFunctionObject::read().
|
static |
Prefix a #line directive to code.
The name of the dictionary is used for the 'file' name.
Definition at line 69 of file dynamicCodeContext.C.
References dict.
bool valid | ( | ) | const |
Considered valid if not using dictionary::null as the context.
Definition at line 97 of file dynamicCodeContext.C.
References dictionary::null.
void setCodeContext | ( | const dictionary & | dict | ) |
Set code context from a dictionary.
Definition at line 103 of file dynamicCodeContext.C.
References dict, dictionary::findEntry(), dynamicCodeContext::inplaceExpand(), keyType::LITERAL, entry::readEntry(), and entry::startLineNumber().
Referenced by dynamicCodeContext::dynamicCodeContext().
|
inline |
Return the parent dictionary context.
Definition at line 128 of file dynamicCodeContext.H.
References dictionary::get().
Referenced by dynamicCodeContext::dynamicCodeContext(), codeStream::getFunction(), and codedBase::updateLibrary().
|
inline |
Return the code-includes.
Definition at line 134 of file dynamicCodeContext.H.
Referenced by dynamicCode::setFilterContext().
|
inline |
Return the code-options.
Definition at line 140 of file dynamicCodeContext.H.
Referenced by codeStream::getFunction(), codedPoints0MotionSolver::prepare(), CodedSource< Type >::prepare(), and codedFunctionObject::prepare().
|
inline |
Return the code-libs.
Definition at line 146 of file dynamicCodeContext.H.
Referenced by codeStream::getFunction(), codedPoints0MotionSolver::prepare(), CodedSource< Type >::prepare(), and codedFunctionObject::prepare().
|
inline |
Return the code.
Definition at line 152 of file dynamicCodeContext.H.
Referenced by dynamicCode::setFilterContext().
|
inline |
Return the local (file-scope) code.
Definition at line 158 of file dynamicCodeContext.H.
Referenced by dynamicCode::setFilterContext().
|
inline |
Return SHA1 calculated from options, libs, include, code.
Definition at line 164 of file dynamicCodeContext.H.
Referenced by codeStream::getFunction(), dynamicCode::setFilterContext(), codedBase::updateLibrary(), and dynamicCode::upToDate().
|
inline |
Add content to SHA1 hashing.
Definition at line 170 of file dynamicCodeContext.H.
References SHA1::append().
|
inline |
Cast to dictionary.
Definition at line 179 of file dynamicCodeContext.H.
References dictionary::get().