|
OOFEM 3.0
|
#include <oofemtxtinputrecord.h>
Public Member Functions | |
| OOFEMTXTInputRecord () | |
| Constructor. Creates an empty input record. | |
| OOFEMTXTInputRecord (int linenumber, std ::string source) | |
| Constructor. Creates the input record corresponding to given string. | |
| OOFEMTXTInputRecord (const OOFEMTXTInputRecord &) | |
| Copy constructor. | |
| OOFEMTXTInputRecord & | operator= (const OOFEMTXTInputRecord &) |
| Assignment operator. | |
| std::shared_ptr< InputRecord > | clone () const override |
| void | setRecordString (std ::string newStr) |
| Sets the record string. | |
| std::string | giveRecordAsString () const override |
| Returns record string. | |
| std::string | giveRecordInTXTFormat () const override |
| std::string | giveLocation () const override |
| void | finish (bool wrn=true) override |
| Terminates the current record session and if the flag is true, warning is printed for unscanned tokens. | |
| void | giveRecordKeywordField (std ::string &answer, int &value) override |
| Reads the record id field (type of record) and its corresponding number. | |
| void | giveRecordKeywordField (std ::string &answer) override |
| Reads the record id field (type of record). | |
| void | giveField (int &answer, InputFieldType id) override |
| Reads the integer field value. | |
| void | giveField (double &answer, InputFieldType id) override |
| Reads the double field value. | |
| void | giveField (bool &answer, InputFieldType id) override |
| Reads the bool field value. | |
| void | giveField (std ::string &answer, InputFieldType id) override |
| Reads the string field value. | |
| void | giveField (FloatArray &answer, InputFieldType id) override |
| Reads the FloatArray field value. | |
| void | giveField (IntArray &answer, InputFieldType id) override |
| Reads the IntArray field value. | |
| void | giveField (FloatMatrix &answer, InputFieldType id) override |
| Reads the FloatMatrix field value. | |
| void | giveField (std ::vector< std ::string > &answer, InputFieldType id) override |
| Reads the vector of strings. | |
| void | giveField (Dictionary &answer, InputFieldType id) override |
| Reads the Dictionary field value. | |
| void | giveField (std ::list< Range > &answer, InputFieldType id) override |
| Reads the std::list<Range> field value. | |
| void | giveField (ScalarFunction &answer, InputFieldType id) override |
| Reads the ScalarFunction field value. | |
| int | giveGroupCount (InputFieldType id, const std::string &name, bool optional) override |
| bool | hasChild (InputFieldType id, const std::string &name, bool optional) override |
| bool | hasField (InputFieldType id) override |
| Returns true if record contains field identified by idString keyword. | |
| void | printYourself () override |
| Print input record. | |
| void | setLineNumber (int num) |
| int | giveLineNumber () const |
| void | setInputRecordType (DataReader::InputRecordType irt) |
| Public Member Functions inherited from oofem::InputRecord | |
| InputRecord () | |
| InputRecord (DataReader *reader_) | |
| virtual | ~InputRecord ()=default |
| Destructor. | |
| std::shared_ptr< InputRecord > | ptr () |
| template<typename T> | |
| void | giveOptionalField (T &answer, InputFieldType id) |
| DataReader * | giveReader () const |
| template<typename AnEnum> | |
| void | giveField (AnEnum &answer, InputFieldType id) |
| Reads enumeration (must be defined via enum-impl.hpp) directly. | |
| void | traceField (InputFieldType id, const char *type) const |
Protected Member Functions | |
| int | giveKeywordIndx (const char *kwd) |
| const char * | scanInteger (const char *source, int &value) |
| const char * | scanDouble (const char *source, double &value) |
| void | setReadFlag (int itok) |
| int | readRange (const char **helpSource, int &li, int &hi) |
| int | readMatrix (const char *helpSource, int r, int c, FloatMatrix &ans) |
Protected Attributes | |
| Tokenizer | tokenizer |
| std ::vector< bool > | readFlag |
| std::string | record |
| Record representation. | |
| int | lineNumber |
| DataReader::InputRecordType | inputRecordType =DataReader::IR_unspecified |
Additional Inherited Members | |
| static std::string | error_msg_with_hints (const std::string &val, const std::map< int, std::vector< std::string > > &v2nn) |
| static int | giveLevenshteinDist (const std::string &word1, const std::string &word2) |
Class representing the Input Record for OOFEM txt input file format. The input record is represented as string consisting of several fields.
Definition at line 52 of file oofemtxtinputrecord.h.
| oofem::OOFEMTXTInputRecord::OOFEMTXTInputRecord | ( | ) |
Constructor. Creates an empty input record.
Definition at line 54 of file oofemtxtinputrecord.C.
References record, and tokenizer.
Referenced by OOFEMTXTInputRecord(), and operator=().
| oofem::OOFEMTXTInputRecord::OOFEMTXTInputRecord | ( | int | linenumber, |
| std ::string | source ) |
Constructor. Creates the input record corresponding to given string.
Definition at line 68 of file oofemtxtinputrecord.C.
References lineNumber, readFlag, record, and tokenizer.
| oofem::OOFEMTXTInputRecord::OOFEMTXTInputRecord | ( | const OOFEMTXTInputRecord & | src | ) |
Copy constructor.
Definition at line 57 of file oofemtxtinputrecord.C.
References inputRecordType, lineNumber, OOFEMTXTInputRecord(), readFlag, record, and tokenizer.
|
inlineoverridevirtual |
Creates a newly allocated copy of the receiver
Implements oofem::InputRecord.
Definition at line 77 of file oofemtxtinputrecord.h.
|
overridevirtual |
Terminates the current record session and if the flag is true, warning is printed for unscanned tokens.
Implements oofem::InputRecord.
Definition at line 545 of file oofemtxtinputrecord.C.
References OOFEM_WARNING, readFlag, record, and tokenizer.
|
overridevirtual |
Reads the bool field value.
Implements oofem::InputRecord.
Definition at line 192 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the Dictionary field value.
Implements oofem::InputRecord.
Definition at line 358 of file oofemtxtinputrecord.C.
References oofem::Dictionary::add(), oofem::Dictionary::clear(), giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), scanDouble(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the double field value.
Implements oofem::InputRecord.
Definition at line 174 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), scanDouble(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the FloatArray field value.
Implements oofem::InputRecord.
Definition at line 270 of file oofemtxtinputrecord.C.
References oofem::FloatArray::at(), giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), oofem::FloatArray::resize(), scanDouble(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the FloatMatrix field value.
Implements oofem::InputRecord.
Definition at line 302 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), readMatrix(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the integer field value.
Implements oofem::InputRecord.
Definition at line 156 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
Referenced by giveGroupCount(), and oofem::oofegGraphicContext::setElementFilterState().
|
overridevirtual |
Reads the IntArray field value.
Implements oofem::InputRecord.
Definition at line 238 of file oofemtxtinputrecord.C.
References oofem::IntArray::at(), giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), oofem::IntArray::resize(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the ScalarFunction field value.
Implements oofem::InputRecord.
Definition at line 436 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), scanDouble(), scanInteger(), setReadFlag(), oofem::ScalarFunction::setReference(), oofem::ScalarFunction::setSimpleExpression(), oofem::ScalarFunction::setValue(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the std::list<Range> field value.
Implements oofem::InputRecord.
Definition at line 397 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, OOFEM_WARNING, readRange(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the string field value.
Implements oofem::InputRecord.
Definition at line 212 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Reads the vector of strings.
Implements oofem::InputRecord.
Definition at line 334 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), lineNumber, oofem::InputRecord::ptr(), scanInteger(), setReadFlag(), tokenizer, and oofem::InputRecord::traceField().
|
overridevirtual |
Implements oofem::InputRecord.
Definition at line 101 of file oofemtxtinputrecord.C.
References giveField(), and oofem::InputRecord::giveOptionalField().
Referenced by hasChild().
|
protected |
Definition at line 532 of file oofemtxtinputrecord.C.
References tokenizer.
Referenced by giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), and hasField().
|
inline |
Definition at line 111 of file oofemtxtinputrecord.h.
References lineNumber.
Referenced by giveLocation().
|
overridevirtual |
Implements oofem::InputRecord.
Definition at line 96 of file oofemtxtinputrecord.C.
References giveLineNumber(), and oofem::InputRecord::giveReader().
|
inlineoverridevirtual |
Returns record string.
Implements oofem::InputRecord.
Definition at line 83 of file oofemtxtinputrecord.h.
|
inlineoverridevirtual |
Implements oofem::InputRecord.
Definition at line 84 of file oofemtxtinputrecord.h.
|
overridevirtual |
Reads the record id field (type of record).
Implements oofem::InputRecord.
Definition at line 145 of file oofemtxtinputrecord.C.
References lineNumber, setReadFlag(), and tokenizer.
|
overridevirtual |
Reads the record id field (type of record) and its corresponding number.
Implements oofem::InputRecord.
Definition at line 129 of file oofemtxtinputrecord.C.
References lineNumber, oofem::InputRecord::ptr(), scanInteger(), setReadFlag(), and tokenizer.
|
overridevirtual |
Implements oofem::InputRecord.
Definition at line 109 of file oofemtxtinputrecord.C.
References giveGroupCount(), and OOFEM_ERROR.
|
overridevirtual |
Returns true if record contains field identified by idString keyword.
Implements oofem::InputRecord.
Definition at line 479 of file oofemtxtinputrecord.C.
References giveKeywordIndx(), setReadFlag(), and oofem::InputRecord::traceField().
| OOFEMTXTInputRecord & oofem::OOFEMTXTInputRecord::operator= | ( | const OOFEMTXTInputRecord & | src | ) |
Assignment operator.
Definition at line 80 of file oofemtxtinputrecord.C.
References inputRecordType, OOFEMTXTInputRecord(), readFlag, record, and tokenizer.
|
overridevirtual |
Print input record.
Implements oofem::InputRecord.
Definition at line 492 of file oofemtxtinputrecord.C.
References record.
|
protected |
Reads single matrix record from input record represented by *helpSource string.
| helpSource | Pointer to current string position, on return helpSource points to next character after reading range record. |
| r | Matrix rows. |
| c | Matrix columns. |
| ans | Float matrix. |
Definition at line 633 of file oofemtxtinputrecord.C.
References oofem::FloatMatrix::at(), oofem::FloatMatrix::clear(), OOFEM_WARNING, oofem::FloatMatrix::resize(), and scanDouble().
Referenced by giveField().
|
protected |
Reads single range record from input record represented by *helpSource string.
| helpSource | Pointer to current string position, on return helpSource points to next character after reading range record. |
| li | Starting range index. |
| hi | End range index. |
Definition at line 585 of file oofemtxtinputrecord.C.
References OOFEM_WARNING.
Referenced by giveField().
|
protected |
Definition at line 515 of file oofemtxtinputrecord.C.
Referenced by giveField(), giveField(), giveField(), giveField(), and readMatrix().
|
protected |
Definition at line 498 of file oofemtxtinputrecord.C.
Referenced by giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), and giveRecordKeywordField().
|
inline |
Definition at line 112 of file oofemtxtinputrecord.h.
References inputRecordType.
|
inline |
Definition at line 110 of file oofemtxtinputrecord.h.
|
inlineprotected |
Definition at line 118 of file oofemtxtinputrecord.h.
References readFlag.
Referenced by giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveRecordKeywordField(), giveRecordKeywordField(), and hasField().
| void oofem::OOFEMTXTInputRecord::setRecordString | ( | std ::string | newStr | ) |
Sets the record string.
Definition at line 117 of file oofemtxtinputrecord.C.
|
protected |
Definition at line 66 of file oofemtxtinputrecord.h.
Referenced by OOFEMTXTInputRecord(), operator=(), and setInputRecordType().
|
protected |
Definition at line 65 of file oofemtxtinputrecord.h.
Referenced by giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveLineNumber(), giveRecordKeywordField(), giveRecordKeywordField(), OOFEMTXTInputRecord(), and OOFEMTXTInputRecord().
|
protected |
Definition at line 61 of file oofemtxtinputrecord.h.
Referenced by finish(), OOFEMTXTInputRecord(), OOFEMTXTInputRecord(), operator=(), setReadFlag(), and setRecordString().
|
protected |
Record representation.
Definition at line 64 of file oofemtxtinputrecord.h.
Referenced by finish(), OOFEMTXTInputRecord(), OOFEMTXTInputRecord(), OOFEMTXTInputRecord(), operator=(), printYourself(), and setRecordString().
|
protected |
Tokenizer is used to parse records. This also enables to perform additional check for input records, since unread fields can be detected
Definition at line 60 of file oofemtxtinputrecord.h.
Referenced by finish(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveField(), giveKeywordIndx(), giveRecordKeywordField(), giveRecordKeywordField(), OOFEMTXTInputRecord(), OOFEMTXTInputRecord(), OOFEMTXTInputRecord(), operator=(), and setRecordString().