OOFEM 3.0
Loading...
Searching...
No Matches
xmlinputrecord.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef xmlinputrecord_h
36#define xmlinputrecord_h
37
38#include "inputrecord.h"
39
40#include <pugixml.hpp>
41
42#include <string>
43#include <vector>
44#include <iostream>
45#include <set>
46
47#define _XML_NI std::cerr<<__PRETTY_FUNCTION__<<": not yet implemented."<<std::endl; abort();
48
49namespace oofem {
50class XMLDataReader;
56{
57 pugi::xml_node node;
59 std::set<std::string> attrQueried;
60 std::set<std::string> attrRead;
61 int recId=-1;
62 XMLDataReader* _reader() const { return (XMLDataReader*)(this->giveReader()); }
63 static std::string xmlizeAttrName(const std::string& s);
64public:
65 std::string _attr_traced_read(const char* name){ return std::get<0>(_attr_traced_read_with_node(name)); }
66 std::tuple<std::string,pugi::xml_node> _attr_traced_read_with_node(const char* name);
67
68 XMLInputRecord(XMLDataReader* reader_, const pugi::xml_node& node_);
69 std::shared_ptr<InputRecord> clone() const override { return std::make_shared<XMLInputRecord>(*this); }
70
71 void finish(bool wrn = true) override;
72
73 std::string loc() const { return loc(node); }
74 std::string loc(const pugi::xml_node& node) const ;
75 int setRecId(int lastRecId);
76
77
78 void giveRecordKeywordField(std :: string &answer, int &value) override;
79 void giveRecordKeywordField(std :: string &answer) override;
80 void giveField(int &answer, InputFieldType id) override;
81 void giveField(double &answer, InputFieldType id) override;
82 void giveField(bool &answer, InputFieldType id) override;
83 void giveField(std :: string &answer, InputFieldType id) override;
84 void giveField(FloatArray &answer, InputFieldType id) override;
85 void giveField(IntArray &answer, InputFieldType id) override;
86 void giveField(FloatMatrix &answer, InputFieldType id) override;
87 void giveField(std :: vector< std :: string > &answer, InputFieldType id) override { _XML_NI; }
88 void giveField(Dictionary &answer, InputFieldType id) override;
89 void giveField(std :: list< Range > &answer, InputFieldType id) override;
90 void giveField(ScalarFunction &answer, InputFieldType id) override;
91
92 int giveGroupCount(InputFieldType id, const std::string& name, bool optional) override;
93 bool hasChild(InputFieldType id, const std::string& name, bool optional) override;
94
95 bool hasField(InputFieldType id) override;
96 void printYourself() override { _XML_NI; }
97
98 std::string giveRecordAsString() const override;
99 std::string giveRecordInTXTFormat() const override;
100 std::string giveLocation() const override { return loc(); }
101
102
103 static bool node_seen_get(const pugi::xml_node& n);
104 static void node_seen_set(pugi::xml_node& n, bool seen);
105 static constexpr char SeenMark[]="__seen";
106};
107} // end namespace oofem
108#endif // xmlinputrecord_h
DataReader * giveReader() const
void printYourself() override
Print input record.
std::string giveLocation() const override
std::set< std::string > attrRead
void giveField(int &answer, InputFieldType id) override
Reads the integer field value.
std::string loc() const
static constexpr char SeenMark[]
void giveField(std ::vector< std ::string > &answer, InputFieldType id) override
Reads the vector of strings.
bool hasField(InputFieldType id) override
Returns true if record contains field identified by idString keyword.
void giveRecordKeywordField(std ::string &answer, int &value) override
Reads the record id field (type of record) and its corresponding number.
int giveGroupCount(InputFieldType id, const std::string &name, bool optional) override
std::tuple< std::string, pugi::xml_node > _attr_traced_read_with_node(const char *name)
bool hasChild(InputFieldType id, const std::string &name, bool optional) override
std::string _attr_traced_read(const char *name)
void giveField(std ::string &answer, InputFieldType id) override
Reads the string field value.
XMLInputRecord(XMLDataReader *reader_, const pugi::xml_node &node_)
void giveField(std ::list< Range > &answer, InputFieldType id) override
Reads the std::list<Range> field value.
std::set< std::string > attrQueried
XMLDataReader * _reader() const
std::shared_ptr< InputRecord > clone() const override
const char * InputFieldType
Identifier of fields in input records.
Definition inputrecord.h:59
#define OOFEM_EXPORT
Definition oofemcfg.h:7
#define _XML_NI

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011