Dictionary entry that contains C++ OpenFOAM code that is compiled to generate the entry itself. So. More...
Public Member Functions | |
ClassName ("codeStream") | |
Runtime type information. More... | |
![]() | |
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) |
![]() | |
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< entry > | clone (const dictionary &) const |
Clone the entry. More... | |
virtual const fileName & | name () const |
Return the token stream name. More... | |
virtual fileName & | name () |
Return token stream name for modification. More... | |
virtual fileName | relativeName () const |
Return token stream name relative to the current case. 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 noexcept |
Return true - this entry is a stream. More... | |
virtual ITstream & | stream () const |
Return token stream for this primitive entry. More... | |
virtual const dictionary & | dict () const |
This entry is not a dictionary,. More... | |
virtual dictionary & | dict () |
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< primitiveEntry > | info () const |
Return info proxy. More... | |
virtual Istream & | read (token &tok) |
Inherit read from ITstream. More... | |
virtual Istream & | read (char &) |
Inherit read from ITstream. More... | |
virtual Istream & | read (word &) |
Inherit read from ITstream. More... | |
virtual Istream & | read (string &) |
Inherit read from ITstream. More... | |
virtual Istream & | read (label &) |
Inherit read from ITstream. More... | |
virtual Istream & | read (floatScalar &) |
Inherit read from ITstream. More... | |
virtual Istream & | read (doubleScalar &) |
Inherit read from ITstream. More... | |
virtual Istream & | read (char *data, std::streamsize) |
Inherit read from ITstream. More... | |
![]() | |
entry (const keyType &keyword) | |
Construct from keyword. More... | |
entry (const entry &e) | |
Construct as copy. More... | |
virtual autoPtr< entry > | clone () const |
Construct on freestore as copy. More... | |
virtual | ~entry ()=default |
Destructor. More... | |
const keyType & | keyword () const noexcept |
Return keyword. More... | |
keyType & | keyword () noexcept |
Return non-const access to keyword. More... | |
virtual bool | isDict () const noexcept |
Return true if this entry is a dictionary. More... | |
virtual const dictionary * | dictPtr () const noexcept |
Return pointer to dictionary, if entry is a dictionary. More... | |
virtual dictionary * | dictPtr () noexcept |
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 |
![]() | |
ITstream (const ITstream &is) | |
Copy construct. More... | |
ITstream (ITstream &&is) | |
Move construct. More... | |
ITstream (IOstreamOption streamOpt=IOstreamOption(), const string &name="input") | |
Default construct. Empty stream, optionally with given name. More... | |
ITstream (const Foam::zero, const string &name="input", IOstreamOption streamOpt=IOstreamOption()) | |
Construct empty, optionally with given name. More... | |
ITstream (const string &name, const UList< token > &tokens, IOstreamOption streamOpt=IOstreamOption()) | |
Copy construct from tokens, with given name. More... | |
ITstream (const string &name, List< token > &&tokens, IOstreamOption streamOpt=IOstreamOption()) | |
Move construct from tokens, with given name. More... | |
ITstream (const UList< char > &input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input") | |
Construct token list by parsing the input character sequence. More... | |
ITstream (const std::string &input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input") | |
Construct token list by parsing the input string. More... | |
ITstream (const char *input, IOstreamOption streamOpt=IOstreamOption(), const string &name="input") | |
Construct token list by parsing the input character sequence. More... | |
virtual | ~ITstream ()=default |
Destructor. More... | |
bool | hasPutback () const noexcept |
True if putback token is in use. More... | |
const token & | peekFirst () const |
Failsafe peek at the first token in the list. More... | |
const token & | peekLast () const |
Failsafe peek at the last token in the list. More... | |
const token & | peek () const |
Failsafe peek at what the next read would return,. More... | |
label | tokenIndex () const noexcept |
The current token index when reading, or the insertion point. More... | |
label & | tokenIndex () noexcept |
Non-const access to the current token index. More... | |
label | nRemainingTokens () const noexcept |
Number of tokens remaining. More... | |
void | seek (label pos) |
Move tokenIndex to the specified position. More... | |
void | skip (label n=1) |
Move tokenIndex relative to the current 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) |
virtual ios_base::fmtflags | flags () const |
Get stream flags - always 0. More... | |
ios_base::fmtflags | flags (const ios_base::fmtflags) |
Set flags of stream - ignored. More... | |
virtual Istream & | read (token &tok) |
Return next token from stream. More... | |
virtual Istream & | read (char &) |
Read a character. More... | |
virtual Istream & | read (word &) |
Read a word. More... | |
virtual Istream & | read (string &) |
Read a string (including enclosing double-quotes) More... | |
virtual Istream & | read (label &) |
Read a label. More... | |
virtual Istream & | read (floatScalar &) |
Read a floatScalar. More... | |
virtual Istream & | read (doubleScalar &) |
Read a doubleScalar. More... | |
virtual Istream & | read (char *data, std::streamsize) |
Read binary block. More... | |
virtual Istream & | readRaw (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 | 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... | |
![]() | |
Istream (const Istream &)=default | |
Copy construct. More... | |
virtual | ~Istream ()=default |
Destructor. More... | |
Istream (IOstreamOption streamOpt=IOstreamOption()) | |
Istream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
Construct with format, version (compression) More... | |
const token & | peekBack () const noexcept |
Examine putback token without removing it. More... | |
bool | peekBack (token &tok) |
Fetch putback token without removing it. More... | |
void | putBack (const token &tok) |
Put back a token. Only a single put back is permitted. More... | |
bool | getBack (token &tok) |
Get the put-back token if there is one. 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... | |
Istream & | operator() () const |
Return a non-const reference to const Istream. More... | |
![]() | |
IOstream (const IOstream &)=default | |
Copy construct. More... | |
virtual | ~IOstream ()=default |
Destructor. More... | |
IOstream (IOstreamOption streamOpt=IOstreamOption()) | |
IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
Construct with format, version (compression) More... | |
fileName | relativeName () const |
Return the name of the stream relative to the current case. 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 noexcept |
True if stream has been opened. More... | |
bool | closed () const noexcept |
True if stream is closed. More... | |
bool | good () const noexcept |
True if next operation might succeed. More... | |
bool | eof () const noexcept |
True if end of input seen. More... | |
bool | fail () const noexcept |
True if next operation will fail. More... | |
bool | bad () const noexcept |
True if stream is corrupted. More... | |
operator bool () const noexcept | |
Return true if the stream has not failed. More... | |
bool | operator! () const noexcept |
Return true if the stream has failed. More... | |
unsigned | labelByteSize () const noexcept |
The sizeof (label) in bytes associated with the stream. More... | |
unsigned | scalarByteSize () const noexcept |
The sizeof (scalar) in bytes associated with the stream. More... | |
void | setLabelByteSize (unsigned nbytes) noexcept |
Set the sizeof (label) in bytes associated with the stream. More... | |
void | setScalarByteSize (unsigned nbytes) noexcept |
Set the sizeof (scalar) in bytes associated with the stream. More... | |
template<class T = label> | |
std::enable_if< std::is_integral< T >::value, bool >::type | checkLabelSize () const noexcept |
template<class T = scalar> | |
std::enable_if< std::is_floating_point< T >::value, bool >::type | checkScalarSize () const noexcept |
label | lineNumber () const noexcept |
Const access to the current stream line number. More... | |
label & | lineNumber () noexcept |
Non-const access to the current stream line number. More... | |
label | lineNumber (const label num) noexcept |
Set the stream line number. More... | |
void | setEof () noexcept |
Set stream state as reached 'eof'. More... | |
void | setFail () noexcept |
Set stream state as 'failed'. More... | |
void | setBad () |
Set stream state 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< IOstream > | info () const |
Return info proxy. More... | |
![]() | |
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... | |
![]() | |
constexpr | List () noexcept |
Default construct. 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<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 | clear () |
Clear the list, i.e. set size to zero. More... | |
void | resize (const label len) |
Adjust allocated size of list. More... | |
void | resize (const label len, const T &val) |
Adjust allocated size of list and set val for new elements. More... | |
void | resize_nocopy (const label len) |
Adjust allocated size of list without necessarily. More... | |
void | setSize (const label n) |
Alias for resize() More... | |
void | setSize (const label n, const T &val) |
Alias for resize() 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... | |
label | appendUniq (const T &val) |
Append an element if not already in the list. More... | |
void | transfer (List< T > &list) |
template<int SizeMin> | |
void | transfer (DynamicList< T, SizeMin > &list) |
void | transfer (SortableList< T > &list) |
T & | newElmt (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... | |
Istream & | readList (Istream &is) |
Read List from Istream, discarding contents of existing List. 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<> | |
Istream & | readList (Istream &is) |
template<> | |
void | resize (const label newLen) |
template<> | |
Istream & | readList (Istream &is) |
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 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 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< entry > | New (Istream &is) |
Construct an entry from Istream. More... | |
static void | resetInputMode () |
Reset the globalInputMode to merge. More... | |
![]() | |
static tokenList | parse (const UList< char > &input, IOstreamOption streamOpt=IOstreamOption()) |
static tokenList | parse (const std::string &input, IOstreamOption streamOpt=IOstreamOption()) |
static tokenList | parse (const char *input, IOstreamOption streamOpt=IOstreamOption()) |
![]() | |
static unsigned int | defaultPrecision () noexcept |
Return the default precision. More... | |
static unsigned int | defaultPrecision (unsigned int prec) noexcept |
Reset the default precision. More... | |
![]() | |
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 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 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 unsigned int | precision_ |
Default precision. More... | |
![]() | |
static const Enum< streamFormat > | formatNames |
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 dlLibraryTable & | libs (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 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) |
static bool | continueReadUntilRightBrace (Istream &is, std::string &str, const bool stripComments=true) |
Slurp a string until a closing '}' is found. More... | |
![]() | |
static void | reportReadWarning (const IOstream &, const std::string &) |
Report a read warning (on std::cerr) More... | |
Additional Inherited Members | |
![]() | |
enum | inputMode { MERGE, OVERWRITE, PROTECT, WARN, ERROR, GLOBAL } |
The input mode options. More... | |
![]() | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
Enumeration for stream open/closed state. More... | |
![]() | |
enum | streamFormat : char { ASCII = 0, BINARY } |
Data format (ascii | binary) More... | |
enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
Compression treatment (UNCOMPRESSED | COMPRESSED) More... | |
![]() | |
typedef SubList< T > | subList |
Declare type of subList. More... | |
![]() | |
functionEntry (const functionEntry &)=delete | |
No copy construct. More... | |
void | operator= (const functionEntry &)=delete |
No copy assignment. More... | |
![]() | |
bool | hasPutback () const noexcept |
True if putback token is in use. More... | |
![]() | |
void | setOpened () noexcept |
Set stream opened. More... | |
void | setClosed () noexcept |
Set stream closed. More... | |
void | setState (std::ios_base::iostate state) noexcept |
Set stream state. More... | |
void | setGood () noexcept |
Set stream state to be good. More... | |
![]() | |
std::ios_base::iostate | ioState_ |
Mirror of internal stream io state. More... | |
streamAccess | openClosed_ |
The stream open/closed state. More... | |
unsigned char | sizeofLabel_ |
The sizeof (label), possibly read from the header. More... | |
unsigned char | sizeofScalar_ |
The sizeof (scalar), possibly read from the header. More... | |
label | lineNumber_ |
The file line. More... | |
![]() | |
static fileName | staticName_ |
Name for any generic stream - normally treat as readonly. More... | |
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/
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:
$
and ~
sequences)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
Definition at line 116 of file codeStream.H.
|
protected |
Interpreter function type.
Definition at line 123 of file codeStream.H.
|
staticprotected |
Helper: access IOobject for master-only-reading functionality.
Definition at line 77 of file codeStream.C.
References DebugPout, dict, and Foam::endl().
|
staticprotected |
Helper function: access to dlLibraryTable of Time.
Definition at line 68 of file codeStream.C.
References dict.
|
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 107 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().
|
staticprotected |
Evaluate dynamically compiled code, returning result as string.
Definition at line 352 of file codeStream.C.
References DetailInfo, Foam::endl(), IOstreamOption::format(), IOstream::lineNumber(), os(), and dictionary::relativeName().
ClassName | ( | "codeStream" | ) |
Runtime type information.
|
static |
Execute in a primitiveEntry context.
Definition at line 384 of file codeStream.C.
References Foam::stringOps::evaluate().
|
static |
Execute in a sub-dict context.
Definition at line 398 of file codeStream.C.
References Foam::stringOps::evaluate(), and dictionary::read().
|
staticconstexpr |
Name of the C code template to be used.
Definition at line 149 of file codeStream.H.