WRApplication
External kratos "application" for multiscale time integration.
|
A class for keeping administrational text data throughout an analysis. More...
Classes | |
class | iterator |
An iterator wrapping JournalBase::iterator but with Parameters as value_type. More... | |
Public Types | |
using | const_iterator = iterator |
using | value_type = iterator::value_type |
using | size_type = std::size_t |
using | Extractor = std::function< Parameters(const Model &)> |
Public Member Functions | |
KRATOS_CLASS_POINTER_DEFINITION (Journal) | |
Journal () | |
Construct the object with an empty file name (invalid). More... | |
Journal (const std::filesystem::path &rJournalPath) | |
Construct a registry given an associated file path and a no-op extractor. More... | |
Journal (const std::filesystem::path &rJournalPath, const Extractor &rExtractor) | |
Construct a registry given an associated file path and extractor. More... | |
Journal (Journal &&rOther)=delete | |
The move constructor is deleted because it's ambiguous what should happen to the associated file. More... | |
Journal (const Journal &rOther)=default | |
Copy constructor. More... | |
Journal & | operator= (Journal &&rOther)=delete |
The move assignment operator is deleted because it's ambiguous what should happen to the associated file. More... | |
Journal & | operator= (const Journal &rOther)=default |
Copy assignment operator. More... | |
const std::filesystem::path & | GetFilePath () const noexcept |
Get the path to the associated file. More... | |
void | SetExtractor (Extractor &&rExtractor) |
Set the extractor handling the conversion from Model to a string. More... | |
void | SetExtractor (const Extractor &rExtractor) |
void | Push (const Model &rModel) |
Call the extractor and append the results to the associated file. More... | |
void | Erase (const_iterator itEntry) |
Erase an entry from the associated file. More... | |
void | Erase (const_iterator Begin, const_iterator End) |
Erase a range of entries from the associated file. More... | |
void | EraseIf (const std::function< bool(const value_type &)> &rPredicate) |
Erase all lines from the associated file matching the input predicate. More... | |
void | Clear () |
JournalBase::Clear() More... | |
bool | IsOpen () const noexcept |
Check whether the associated file is opened by this object. More... | |
const_iterator | begin () const |
Create an iterator to the first line of the associated file. More... | |
const_iterator | end () const |
Create an iterator to the last (empty) line of the associated file. More... | |
size_type | size () const |
Count the number of lines in the file (including the last empty one). More... | |
A class for keeping administrational text data throughout an analysis.
This is a wrapper class around JournalBase, but writes entries via Parameters objects instead of raw strings, offering a bit more convenience.
using const_iterator = iterator |
using Extractor = std::function<Parameters(const Model&)> |
using size_type = std::size_t |
using value_type = iterator::value_type |
Journal | ( | ) |
Construct the object with an empty file name (invalid).
Journal | ( | const std::filesystem::path & | rJournalPath | ) |
Construct a registry given an associated file path and a no-op extractor.
Construct a registry given an associated file path and extractor.
The move constructor is deleted because it's ambiguous what should happen to the associated file.
Copy constructor.
const_iterator begin | ( | ) | const |
Create an iterator to the first line of the associated file.
void Clear | ( | ) |
const_iterator end | ( | ) | const |
Create an iterator to the last (empty) line of the associated file.
void Erase | ( | const_iterator | Begin, |
const_iterator | End | ||
) |
Erase a range of entries from the associated file.
This operation is extremely inefficient, as a new new file has to be written that contains every line of the currently associated file except those to be erased.
void Erase | ( | const_iterator | itEntry | ) |
Erase an entry from the associated file.
This operation is extremely inefficient, as a new new file has to be written that contains every line of the currently associated file except the erased one.
void EraseIf | ( | const std::function< bool(const value_type &)> & | rPredicate | ) |
Erase all lines from the associated file matching the input predicate.
|
noexcept |
Get the path to the associated file.
|
noexcept |
Check whether the associated file is opened by this object.
KRATOS_CLASS_POINTER_DEFINITION | ( | Journal | ) |
Copy assignment operator.
The move assignment operator is deleted because it's ambiguous what should happen to the associated file.
void Push | ( | const Model & | rModel | ) |
Call the extractor and append the results to the associated file.
void SetExtractor | ( | const Extractor & | rExtractor | ) |
void SetExtractor | ( | Extractor && | rExtractor | ) |
Set the extractor handling the conversion from Model to a string.
The extractor must generate a string without any line breaks.
size_type size | ( | ) | const |
Count the number of lines in the file (including the last empty one).