codeStream Class Reference

Dictionary entry that contains C++ OpenFOAM code that is compiled to generate the entry itself. So. More...

Inheritance diagram for codeStream:
[legend]
Collaboration diagram for codeStream:
[legend]

Public Member Functions

 ClassName ("codeStream")
 Runtime type information. More...
 
- Public Member Functions inherited from functionEntry
 functionEntry (const word &key, const dictionary &dict, Istream &is)
 Construct from keyword, parent dictionary and Istream. More...
 
 declareMemberFunctionSelectionTable (bool, functionEntry, execute, dictionaryIstream,(dictionary &parentDict, Istream &is),(parentDict, is))
 
 declareMemberFunctionSelectionTable (bool, functionEntry, execute, primitiveEntryIstream,(const dictionary &parentDict, primitiveEntry &entry, Istream &is),(parentDict, entry, is))
 
virtual void write (Ostream &os) const
 Write. More...
 
template<class StringType >
Foam::List< StringType > readStringList (Istream &is)
 
- Public Member Functions inherited from primitiveEntry
 primitiveEntry (const keyType &key)
 Construct from keyword and no tokens. More...
 
 primitiveEntry (const keyType &key, const token &tok)
 Construct from keyword and a single token. More...
 
 primitiveEntry (const keyType &key, const UList< token > &tokens)
 Construct from keyword and a list of tokens. More...
 
 primitiveEntry (const keyType &key, List< token > &&tokens)
 Construct from keyword and by transferring a list of tokens. More...
 
 primitiveEntry (const keyType &key, const ITstream &is)
 Construct from keyword and ITstream tokens. More...
 
 primitiveEntry (const keyType &key, Istream &is)
 Construct from keyword and Istream. More...
 
 primitiveEntry (const keyType &key, const dictionary &dict, Istream &is)
 Construct from keyword, parent dictionary and Istream. More...
 
template<class T >
 primitiveEntry (const keyType &key, const T &val)
 Construct from keyword and a value. Uses string stream serialization. More...
 
autoPtr< entryclone (const dictionary &) const
 Clone the entry. More...
 
virtual const fileNamename () const
 Return the dictionary name. More...
 
virtual fileNamename ()
 Return the dictionary name. More...
 
virtual label startLineNumber () const
 Return line number of first token in dictionary. More...
 
virtual label endLineNumber () const
 Return line number of last token in dictionary. More...
 
virtual bool isStream () const
 Return true - this entry is a stream. More...
 
virtual ITstreamstream () const
 Return token stream for this primitive entry. More...
 
virtual const dictionarydict () const
 This entry is not a dictionary,. More...
 
virtual dictionarydict ()
 This entry is not a dictionary,. More...
 
virtual bool read (const dictionary &dict, Istream &is)
 Read tokens from the given stream. More...
 
void write (Ostream &os, const bool contentsOnly) const
 Write, optionally with contents only (no keyword, etc) More...
 
InfoProxy< primitiveEntryinfo () const
 Return info proxy. More...
 
virtual Istreamread (token &tok)
 Inherit read from ITstream. More...
 
virtual Istreamread (char &)
 Inherit read from ITstream. More...
 
virtual Istreamread (word &)
 Inherit read from ITstream. More...
 
virtual Istreamread (string &)
 Inherit read from ITstream. More...
 
virtual Istreamread (label &)
 Inherit read from ITstream. More...
 
virtual Istreamread (floatScalar &)
 Inherit read from ITstream. More...
 
virtual Istreamread (doubleScalar &)
 Inherit read from ITstream. More...
 
virtual Istreamread (char *data, std::streamsize)
 Inherit read from ITstream. More...
 
- Public Member Functions inherited from entry
 entry (const keyType &keyword)
 Construct from keyword. More...
 
 entry (const entry &e)
 Construct as copy. More...
 
virtual autoPtr< entryclone () const
 Construct on freestore as copy. More...
 
virtual ~entry ()=default
 Destructor. More...
 
const keyTypekeyword () const
 Return keyword. More...
 
keyTypekeyword ()
 Return non-const access to keyword. More...
 
virtual bool isDict () const
 Return true if this entry is a dictionary. More...
 
virtual const dictionarydictPtr () const
 Return pointer to dictionary, if entry is a dictionary. More...
 
virtual dictionarydictPtr ()
 Return non-const pointer to dictionary, if entry is a dictionary. More...
 
void checkITstream (const ITstream &is) const
 
template<class T >
T get () const
 
template<class T >
void readEntry (T &val) const
 
template<class T , class Predicate >
T getCheck (const Predicate &pred) const
 
template<class T , class Predicate >
void readCheck (T &val, const Predicate &pred) const
 
void operator= (const entry &e)
 
bool operator== (const entry &e) const
 
bool operator!= (const entry &e) const
 
- Public Member Functions inherited from ITstream
 ITstream (const ITstream &is)
 Copy construct. More...
 
 ITstream (const string &name, IOstreamOption streamOpt=IOstreamOption())
 Construct empty stream with given name. More...
 
 ITstream (const string &name, const UList< token > &tokens, streamFormat format=ASCII, versionNumber version=currentVersion)
 Construct from components. More...
 
 ITstream (const string &name, List< token > &&tokens, streamFormat format=ASCII, versionNumber version=currentVersion)
 Construct from components, transferring the tokens. More...
 
 ITstream (const string &name, const UList< char > &input, streamFormat format=ASCII, versionNumber version=currentVersion)
 Construct token list by parsing the input character sequence. More...
 
 ITstream (const string &name, const std::string &input, streamFormat format=ASCII, versionNumber version=currentVersion)
 Construct token list by parsing the input string. More...
 
 ITstream (const string &name, const char *input, streamFormat format=ASCII, versionNumber version=currentVersion)
 Construct token list by parsing the input character sequence. More...
 
virtual ~ITstream ()=default
 Destructor. More...
 
label tokenIndex () const
 The current token index when reading, or the insertion point. More...
 
label & tokenIndex ()
 Non-const access to the current token index. More...
 
label nRemainingTokens () const
 The number of remaining tokens. More...
 
ios_base::fmtflags flags () const
 Return flags of output stream. More...
 
virtual Istreamread (token &tok)
 Return next token from stream. More...
 
virtual Istreamread (char &)
 Read a character. More...
 
virtual Istreamread (word &)
 Read a word. More...
 
virtual Istreamread (string &)
 Read a string (including enclosing double-quotes) More...
 
virtual Istreamread (label &)
 Read a label. More...
 
virtual Istreamread (floatScalar &)
 Read a floatScalar. More...
 
virtual Istreamread (doubleScalar &)
 Read a doubleScalar. More...
 
virtual Istreamread (char *data, std::streamsize)
 Read binary block. More...
 
virtual IstreamreadRaw (char *data, std::streamsize count)
 Low-level raw binary read. More...
 
virtual bool beginRawRead ()
 Start of low-level raw binary read. More...
 
virtual bool endRawRead ()
 End of low-level raw binary read. More...
 
virtual void rewind ()
 Rewind the stream so that it may be read again. More...
 
void seek (label pos)
 Move the tokenIndex to the specified position. More...
 
void append (const token &t, const bool lazy)
 
void append (token &&t, const bool lazy)
 
void append (const UList< token > &newTokens, const bool lazy)
 
void append (List< token > &&newTokens, const bool lazy)
 
ios_base::fmtflags flags (const ios_base::fmtflags)
 Set flags of stream. More...
 
void print (Ostream &os) const
 Print stream description to Ostream. More...
 
std::string toString () const
 
void operator= (const ITstream &is)
 Copy assignment, with rewind() More...
 
void operator= (const UList< token > &toks)
 Copy assignment of tokens, with rewind() More...
 
void operator= (List< token > &&toks)
 Move assignment of tokens, with rewind() More...
 
- Public Member Functions inherited from Istream
 Istream (const Istream &)=default
 Copy construct. More...
 
virtual ~Istream ()=default
 Destructor. More...
 
 Istream (IOstreamOption streamOpt=IOstreamOption())
 
 Istream (streamFormat fmt, versionNumber ver=currentVersion, compressionType comp=compressionType::UNCOMPRESSED)
 Construct with format, version (compression) More...
 
void putBack (const token &tok)
 Put back token. More...
 
bool getBack (token &tok)
 Get the put back token if there is one and return true. More...
 
bool peekBack (token &tok)
 Peek at the put back token without removing it. More...
 
bool readBegin (const char *funcName)
 Begin read of data chunk, starts with '('. More...
 
bool readEnd (const char *funcName)
 End read of data chunk, ends with ')'. More...
 
char readBeginList (const char *funcName)
 Begin read of list data, starts with '(' or '{'. More...
 
char readEndList (const char *funcName)
 End read of list data, ends with ')' or '}'. More...
 
Istreamoperator() () const
 Return a non-const reference to const Istream. More...
 
- Public Member Functions inherited from IOstream
 IOstream (const IOstream &)=default
 Copy construct. More...
 
virtual ~IOstream ()=default
 Destructor. More...
 
 IOstream (IOstreamOption streamOpt=IOstreamOption())
 
 IOstream (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED)
 Construct with format, version (compression) More...
 
virtual bool check (const char *operation) const
 Check IOstream status for given operation. More...
 
bool fatalCheck (const char *operation) const
 Check IOstream status for given operation. More...
 
bool opened () const
 Return true if stream has been opened. More...
 
bool closed () const
 Return true if stream is closed. More...
 
bool good () const
 Return true if next operation might succeed. More...
 
bool eof () const
 Return true if end of input seen. More...
 
bool fail () const
 Return true if next operation will fail. More...
 
bool bad () const
 Return true if stream is corrupted. More...
 
 operator bool () const
 Return true if the stream has not failed. More...
 
bool operator! () const
 Return true if the stream has failed. More...
 
unsigned labelByteSize () const
 The label byte-size associated with the stream. More...
 
unsigned scalarByteSize () const
 The scalar byte-size associated with the stream. More...
 
void setLabelByteSize (unsigned nbytes)
 Set the label byte-size associated with the stream. More...
 
void setScalarByteSize (unsigned nbytes)
 Set the scalar byte-size associated with the stream. More...
 
template<class T = label>
std::enable_if< std::is_integral< T >::value, bool >::type checkLabelSize () const
 
template<class T = scalar>
std::enable_if< std::is_floating_point< T >::value, bool >::type checkScalarSize () const
 
label lineNumber () const
 Const access to the current stream line number. More...
 
label & lineNumber ()
 Non-const access to the current stream line number. More...
 
label lineNumber (const label num)
 Set the stream line number. More...
 
void setEof ()
 Set stream to have reached eof. More...
 
void setFail ()
 Set stream to have failed. More...
 
void setBad ()
 Set stream to be bad. More...
 
ios_base::fmtflags setf (const ios_base::fmtflags f)
 Set flags of stream. More...
 
ios_base::fmtflags setf (const ios_base::fmtflags f, const ios_base::fmtflags mask)
 Set flags of given field of stream. More...
 
void unsetf (const ios_base::fmtflags f)
 Unset flags of stream. More...
 
void print (Ostream &os, const int streamState) const
 Print information about the stream state bits. More...
 
InfoProxy< IOstreaminfo () const
 Return info proxy. More...
 
- Public Member Functions inherited from IOstreamOption
constexpr IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 
constexpr IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept
 Construct from components (format, compression, version) More...
 
constexpr IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept
 Construct from components (format, version, compression) More...
 
 IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept
 Copy construct with change of format. More...
 
streamFormat format () const noexcept
 Get the current stream format. More...
 
streamFormat format (const streamFormat fmt) noexcept
 Set the stream format. More...
 
streamFormat format (const word &formatName)
 Set the stream format from string value. More...
 
compressionType compression () const noexcept
 Get the stream compression. More...
 
compressionType compression (const compressionType comp) noexcept
 Set the stream compression. More...
 
compressionType compression (const word &compName)
 Set the stream compression from string value. More...
 
versionNumber version () const noexcept
 Get the stream version. More...
 
versionNumber version (const versionNumber ver) noexcept
 Set the stream version. More...
 
versionNumber version (const token &tok)
 Set the stream version from token. More...
 
- Public Member Functions inherited from List< T >
constexpr List () noexcept
 Null constructor. More...
 
 List (const label len)
 Construct with given size. More...
 
 List (const label len, const T &val)
 Construct with given size and value for all elements. More...
 
 List (const label len, const Foam::zero)
 Construct with given size initializing all elements to zero. More...
 
 List (const Foam::one, const T &val)
 Construct with length=1, copying the value as the only content. More...
 
 List (const Foam::one, T &&val)
 Construct with length=1, moving the value as the only content. More...
 
 List (const Foam::one, const Foam::zero)
 Construct with length=1, initializing content to zero. More...
 
 List (const List< T > &a)
 Copy construct from list. More...
 
 List (const UList< T > &a)
 Copy construct contents from list. More...
 
 List (List< T > &a, bool reuse)
 Construct as copy or re-use as specified. More...
 
 List (const UList< T > &list, const labelUList &indices)
 Copy construct subset of list. More...
 
template<unsigned N>
 List (const UList< T > &list, const FixedList< label, N > &indices)
 Copy construct subset of list. More...
 
template<class InputIterator >
 List (InputIterator begIter, InputIterator endIter)
 Construct given begin/end iterators. More...
 
template<unsigned N>
 List (const FixedList< T, N > &list)
 Construct as copy of FixedList<T, N> More...
 
 List (const PtrList< T > &list)
 Construct as copy of PtrList<T> More...
 
 List (const SLList< T > &list)
 Construct as copy of SLList<T> More...
 
template<class Addr >
 List (const IndirectListBase< T, Addr > &list)
 Construct as copy of IndirectList contents. More...
 
 List (std::initializer_list< T > list)
 Construct from an initializer list. More...
 
 List (List< T > &&list)
 Move construct from List. More...
 
template<int SizeMin>
 List (DynamicList< T, SizeMin > &&list)
 Move construct from DynamicList. More...
 
 List (SortableList< T > &&list)
 Move construct from SortableList. More...
 
 List (SLList< T > &&list)
 Move construct from SLList. More...
 
 List (Istream &is)
 Construct from Istream. More...
 
autoPtr< List< T > > clone () const
 Clone. More...
 
 ~List ()
 Destructor. More...
 
void resize (const label newSize)
 Adjust allocated size of list. More...
 
void resize (const label newSize, const T &val)
 Adjust allocated size of list and set val for new elements. More...
 
void setSize (const label newSize)
 Alias for resize(const label) More...
 
void setSize (const label newSize, const T &val)
 Alias for resize(const label, const T&) More...
 
void clear ()
 Clear the list, i.e. set size to zero. More...
 
void append (const T &val)
 Append an element at the end of the list. More...
 
void append (T &&val)
 Move append an element at the end of the list. More...
 
void append (const UList< T > &list)
 Append a List to the end of this list. More...
 
template<class Addr >
void append (const IndirectListBase< T, Addr > &list)
 Append IndirectList contents at the end of this list. More...
 
void transfer (List< T > &list)
 
template<int SizeMin>
void transfer (DynamicList< T, SizeMin > &list)
 
void transfer (SortableList< T > &list)
 
TnewElmt (const label i)
 
void operator= (const UList< T > &a)
 Assignment to UList operator. Takes linear time. More...
 
void operator= (const List< T > &list)
 Assignment operator. Takes linear time. More...
 
void operator= (const SLList< T > &list)
 Assignment to SLList operator. Takes linear time. More...
 
template<class Addr >
void operator= (const IndirectListBase< T, Addr > &list)
 Assignment from IndirectList. Takes linear time. More...
 
template<unsigned N>
void operator= (const FixedList< T, N > &list)
 Copy assignment from FixedList. More...
 
void operator= (std::initializer_list< T > list)
 Assignment to an initializer list. More...
 
void operator= (const T &val)
 Assignment of all entries to the given value. More...
 
void operator= (const Foam::zero)
 Assignment of all entries to zero. More...
 
void operator= (List< T > &&list)
 Move assignment. Takes constant time. More...
 
template<int SizeMin>
void operator= (DynamicList< T, SizeMin > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (SortableList< T > &&list)
 Move assignment. Takes constant time. More...
 
void operator= (SLList< T > &&list)
 Move assignment. Takes constant time. More...
 
void shallowCopy (const UList< T > &)=delete
 No shallowCopy permitted. More...
 
template<class TypeT = T>
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set (const label i, bool val=true)
 A bitSet::set() method for a list of bool. More...
 
template<>
void resize (const label newSize)
 

Static Public Member Functions

static bool execute (const dictionary &parentDict, primitiveEntry &entry, Istream &is)
 Execute in a primitiveEntry context. More...
 
static bool execute (dictionary &parentDict, Istream &is)
 Execute in a sub-dict context. More...
 
- Static Public Member Functions inherited from functionEntry
static bool execute (const word &functionName, dictionary &parentDict, Istream &is)
 Execute the functionEntry in a sub-dict context. More...
 
static bool execute (const word &functionName, const dictionary &parentDict, primitiveEntry &entry, Istream &is)
 Execute the functionEntry in a primitiveEntry context. More...
 
- Static Public Member Functions inherited from entry
static bool New (dictionary &parentDict, Istream &is, const inputMode inpMode=inputMode::GLOBAL, const int endChar=0)
 Construct from an Istream and insert into the dictionary. More...
 
static autoPtr< entryNew (Istream &is)
 Construct an entry from Istream. More...
 
static void resetInputMode ()
 Reset the globalInputMode to merge. More...
 
- Static Public Member Functions inherited from ITstream
static tokenList parse (const UList< char > &input, streamFormat format=ASCII)
 
static tokenList parse (const std::string &input, streamFormat format=ASCII)
 
static tokenList parse (const char *input, streamFormat format=ASCII)
 
- Static Public Member Functions inherited from IOstream
static unsigned int defaultPrecision ()
 Return the default precision. More...
 
static unsigned int defaultPrecision (unsigned int prec)
 Reset the default precision. More...
 
- Static Public Member Functions inherited from IOstreamOption
static streamFormat formatEnum (const word &formatName, const streamFormat deflt=streamFormat::ASCII)
 
static streamFormat formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII)
 Failsafe construct streamFormat from optional dictionary lookup. More...
 
static compressionType compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED)
 The compression enum corresponding to the string. More...
 
static compressionType compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED)
 Failsafe construct compressionType from optional dictionary lookup. More...
 
- Static Public Member Functions inherited from List< T >
static const List< T > & null ()
 Return a null List. More...
 

Static Public Attributes

static constexpr const char *const codeTemplateC = "codeStreamTemplate.C"
 Name of the C code template to be used. More...
 
- Static Public Attributes inherited from entry
static int disableFunctionEntries
 Enable or disable use of function entries and variable expansions. More...
 
static inputMode globalInputMode = inputMode::MERGE
 The current global input-mode. More...
 
- Static Public Attributes inherited from IOstream
static unsigned int precision_
 Default precision. More...
 
- Static Public Attributes inherited from IOstreamOption
static const Enum< streamFormatformatNames
 Stream format names (ascii, binary) More...
 
static const versionNumber currentVersion
 The current version number (2.0) More...
 

Protected Types

typedef void(* streamingFunctionType) (Ostream &, const dictionary &)
 Interpreter function type. More...
 

Static Protected Member Functions

static bool doingMasterOnlyReading (const dictionary &dict)
 Helper: access IOobject for master-only-reading functionality. More...
 
static dlLibraryTablelibs (const dictionary &dict)
 Helper function: access to dlLibraryTable of Time. More...
 
static streamingFunctionType getFunction (const dictionary &parentDict, const dictionary &codeDict)
 Construct, compile, load and return streaming function. More...
 
static string evaluate (const dictionary &parentDict, Istream &is)
 Evaluate dynamically compiled code, returning result as string. More...
 
- Static Protected Member Functions inherited from functionEntry
static token readLine (const word &key, Istream &is)
 Read line and return as a string token. More...
 
template<class StringType >
static List< StringType > readStringList (Istream &is)
 

Additional Inherited Members

- Public Types inherited from entry
enum  inputMode {
  MERGE, OVERWRITE, PROTECT, WARN,
  ERROR, GLOBAL
}
 The input mode options. More...
 
- Public Types inherited from IOstream
enum  streamAccess : char { CLOSED = 0, OPENED }
 Enumeration for stream open/closed state. More...
 
- Public Types inherited from IOstreamOption
enum  streamFormat : char { ASCII = 0, BINARY }
 Data format (ascii | binary) More...
 
enum  compressionType : char { UNCOMPRESSED = 0, COMPRESSED }
 Compression treatment (UNCOMPRESSED | COMPRESSED) More...
 
- Public Types inherited from List< T >
typedef SubList< TsubList
 Declare type of subList. More...
 
- Protected Member Functions inherited from IOstream
void setOpened ()
 Set stream opened. More...
 
void setClosed ()
 Set stream closed. More...
 
void setState (ios_base::iostate state)
 Set stream state. More...
 
void setGood ()
 Set stream to be good. More...
 
- Protected Attributes inherited from IOstream
streamAccess openClosed_
 
ios_base::iostate ioState_
 
unsigned short labelByteSize_
 The label byte-size (could also be stored as byte) More...
 
unsigned short scalarByteSize_
 The scalar byte-size (could also be stored as byte) More...
 
label lineNumber_
 The file line. More...
 
- Static Protected Attributes inherited from IOstream
static fileName staticName_
 Name for any generic stream - normally treat as readonly. More...
 

Detailed Description

Dictionary entry that contains C++ OpenFOAM code that is compiled to generate the entry itself. So.

- codeStream reads three entries: 'code', 'codeInclude' (optional), 'codeOptions' (optional) and uses those to generate library sources inside codeStream/

  • these get compiled using 'wmake libso'
  • the resulting library is loaded in executed with as arguments
    (const dictionary& dict, Ostream& os)
    where the dictionary is the current dictionary.
  • the code has to write into Ostream which is then used to construct the actual dictionary entry.

E.g. to set the internal field of a field:

internalField  #codeStream
{
    code
    #{
        const IOdictionary& d = static_cast<const IOdictionary&>(dict);
        const fvMesh& mesh = refCast<const fvMesh>(d.db());
        scalarField fld(mesh.nCells(), 12.34);
        fld.writeEntry("", os);
    #};

    //! Optional:
    codeInclude
    #{
        #include "fvCFD.H"
    #};

    //! Optional:
    codeOptions
    #{
        -I$(LIB_SRC)/finiteVolume/lnInclude
    #};
};

Note the #{ ... #} syntax is a 'verbatim' input mode that allows inputting strings with embedded newlines.

Limitations:

  • '~' symbol not allowed inside the code sections.
  • probably some other limitations (uses string::expand which expands $ and ~ sequences)
Note
The code to be compiled is stored under the local codeStream directory with a subdirectory name corresponding to the SHA1 of the contents.

The corresponding library code is located under the local codeStream/platforms/$WM_OPTIONS/lib directory in a library libcodeStream_SHA1.so

Source files

Definition at line 116 of file codeStream.H.

Member Typedef Documentation

◆ streamingFunctionType

typedef void(* streamingFunctionType(Ostream &, const dictionary &)
protected

Interpreter function type.

Definition at line 123 of file codeStream.H.

Member Function Documentation

◆ doingMasterOnlyReading()

bool doingMasterOnlyReading ( const dictionary dict)
staticprotected

Helper: access IOobject for master-only-reading functionality.

Definition at line 81 of file codeStream.C.

References DebugPout, dict, Foam::endl(), and IOobject::globalObject().

Here is the call graph for this function:

◆ libs()

Foam::dlLibraryTable & libs ( const dictionary dict)
staticprotected

Helper function: access to dlLibraryTable of Time.

Definition at line 68 of file codeStream.C.

References dict, Time::libs(), and IOobject::time().

Here is the call graph for this function:

◆ getFunction()

Foam::functionEntries::codeStream::streamingFunctionType getFunction ( const dictionary parentDict,
const dictionary codeDict 
)
staticprotected

Construct, compile, load and return streaming function.

Only block if we're not doing master-only reading. (flag set by

regIOobject::read, baseIOdictionary constructor)

Since the library has only been compiled on the master the

other nodes need to pick this library up through NFS We do this by just polling a few times using the fileModificationSkew.

Definition at line 112 of file codeStream.C.

References Foam::BitSetOps::create(), DebugPout, DetailInfo, dynamicCodeContext::dict(), Foam::dlOpen(), Foam::dlSym(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::fileSize(), dynamicCodeContext::libs(), Foam::nl, dynamicCodeContext::options(), reduce(), PackedList< Width >::reset(), dynamicCodeContext::sha1(), Foam::sleep(), SHA1::str(), and dictionary::topDict().

Here is the call graph for this function:

◆ evaluate()

Foam::string evaluate ( const dictionary parentDict,
Istream is 
)
staticprotected

Evaluate dynamically compiled code, returning result as string.

Definition at line 357 of file codeStream.C.

References DetailInfo, Foam::endl(), IOstreamOption::format(), IOstream::lineNumber(), and dictionary::name().

Here is the call graph for this function:

◆ ClassName()

ClassName ( "codeStream"  )

Runtime type information.

◆ execute() [1/2]

bool execute ( const dictionary parentDict,
primitiveEntry entry,
Istream is 
)
static

Execute in a primitiveEntry context.

Definition at line 389 of file codeStream.C.

References Foam::stringOps::evaluate().

Here is the call graph for this function:

◆ execute() [2/2]

bool execute ( dictionary parentDict,
Istream is 
)
static

Execute in a sub-dict context.

Definition at line 403 of file codeStream.C.

References Foam::stringOps::evaluate(), and dictionary::read().

Here is the call graph for this function:

Member Data Documentation

◆ codeTemplateC

constexpr const char* const codeTemplateC = "codeStreamTemplate.C"
staticconstexpr

Name of the C code template to be used.

Definition at line 149 of file codeStream.H.


The documentation for this class was generated from the following files:
Foam::primitiveEntry::dict
virtual const dictionary & dict() const
This entry is not a dictionary,.
Definition: primitiveEntry.C:297