48 class dynamicCodeContext;
94 std::string makeOptions_;
215 return codeRoot_/codeDirName_;
222 return codeRoot_/libSubDir_/
"lib" + codeName_ +
".so";
240 return codeRoot_/codeDirName_/
"Make/SHA1Digest";
fileName libSubDir() const
Subdirectory name for loading libraries.
bool writeDigest(const SHA1Digest &) const
Write digest to Make/SHA1Digest.
const word & codeDirName() const
Return the code-dirname.
A class for handling file names.
void reset(const dynamicCodeContext &)
Clear files and reset variables to specified context.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void setMakeOptions(const std::string &content)
Define contents for Make/options.
const word & codeName() const
Return the code-name.
A 2-tuple for storing two objects of different types.
static const char *const libTargetRoot
Root of the LIB target for Make/files.
static bool resolveTemplates(const UList< fileName > &templateNames, DynamicList< fileName > &resolvedFiles, DynamicList< fileName > &badFiles)
Resolve code-templates via the codeTemplateEnvName.
const fileName & codeRoot() const
Root for dynamic code compilation.
static const word codeTemplateEnvName
Name of the code template environment variable.
static const char *const topDirName
Top-level directory name for copy/compiling.
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 $FOAM_CASE.
fileName digestFile() const
Path for SHA1Digest.
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 $FOAM_CASE.
A class for handling words, derived from string.
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.
dynamicCode(const word &codeName, const word &codeDirName="")
Construct for a specified code name and code directory name.
void addCreateFile(const fileName &name, const string &contents)
Add a file to create with its contents. Will not be filtered.
bool wmakeLibso() const
Compile a libso.
An STL-conforming hash table.
void operator=(const dynamicCode &)=delete
Disallow default bitwise assignment.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
fileName libPath() const
Library path for specified code name.
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.
static word libraryBaseName(const fileName &libPath)
Return the library basename without leading 'lib' or trailing '.so'.
word name(const complex &)
Return a string representation of a complex.
Tools for handling dynamic code compilation.
Encapsulation of dynamic code dictionaries.
void setFilterVariable(const word &key, const std::string &value)
Define a filter variable.
void addCopyFile(const fileName &name)
Add a file template name, which will be found and filtered.
void clear()
Clear files and variables.
static void checkSecurity(const char *title, const dictionary &)
Check security for creating dynamic code.
bool createMakeFiles() const
Copy/create Make/files prior to compilation.
Tuple2< fileName, string > fileAndContent