38 #ifndef Foam_dynamicCode_H 39 #define Foam_dynamicCode_H 52 class dynamicCodeContext;
90 std::string makeOptions_;
202 return codeRoot_/codeDirName_;
223 return codeRoot_/codeDirName_/
"Make/SHA1Digest";
231 void reset(
const dynamicCodeContext&);
290 val[0] = toupper(val[0]);
Generic output stream using a standard (STL) stream.
bool writeDigest(const SHA1Digest &) const
Write digest to Make/SHA1Digest.
A class for handling file names.
void addCreateFile(const fileName &name, const std::string &contents)
Add a file to create with its contents. Will not be filtered.
void reset(const dynamicCodeContext &)
Clear files and reset variables to specified context.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
void setMakeOptions(const std::string &content)
Define contents for Make/options.
static void waitForFile(const fileName &file, const dictionary &contextDict)
Wait for libPath() file to appear on sub-ranks.
static bool resolveTemplates(const UList< fileName > &templateNames, DynamicList< fileName > &resolvedFiles, DynamicList< fileName > &badFiles)
Resolve code-templates via the codeTemplateEnvName.
A traits class, which is primarily used for primitives and vector-space.
void setFilterContext(const dynamicCodeContext &)
Define filter variables for code, codeInclude, SHA1sum.
static const word codeTemplateEnvName
Name of the code template environment variable.
static const char *const topDirName
Top-level directory name for copy/compiling.
static const char *const targetLibDir
Directory for library targets for Make/files.
void addCompileFile(const fileName &name)
Add a file template name, which will be found and filtered.
bool writeCommentSHA1(Ostream &) const
Write SHA1 value as C-comment.
bool createMakeOptions() const
Copy/create Make/options prior to compilation.
fileName codeRelPath() const
Path for specified code name relative to <case>
fileName digestFile() const
Path for SHA1Digest.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
fileName libRelPath() const
Library path for specified code name relative to <case>
A class for handling words, derived from Foam::string.
const fileName & codeRoot() const noexcept
Root for dynamic code compilation.
static const fileName codeTemplateDirName
Name of the code template sub-directory.
static int allowSystemOperations
Flag if system operations are allowed.
static void copyAndFilter(ISstream &, OSstream &, const HashTable< string > &mapping)
Copy lines while expanding variables.
bool wmakeLibso() const
Compile a libso.
A HashTable similar to std::unordered_map.
void operator=(const dynamicCode &)=delete
No copy assignment.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
fileName codePath() const
Path for specified code name.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool upToDate(const dynamicCodeContext &context) const
Verify if the copied code is up-to-date, based on Make/SHA1Digest.
bool copyOrCreateFiles(const bool verbose=false) const
Copy/create files prior to compilation.
const word & codeName() const noexcept
Return the code-name.
Tools for handling dynamic code compilation.
Encapsulation of dynamic code dictionaries.
Generic input stream using a standard (STL) stream.
void setFilterVariable(const word &key, const std::string &value)
Define a filter variable.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
void addCopyFile(const fileName &name)
Add a file template name, which will be found and filtered.
fileName libPath() const
Library path for specified code name.
void clear()
Clear files and variables.
dynamicCode(const dynamicCode &)=delete
No copy construct.
void setFieldTemplates()
Define a filter variables TemplateType and FieldType.
const word & codeDirName() const noexcept
Return the code-dirname.
static void checkSecurity(const char *title, const dictionary &)
Check security for creating dynamic code.
bool createMakeFiles() const
Copy/create Make/files prior to compilation.
const fileName & libSubDir() const noexcept
Subdirectory name for loading libraries.