49 _subtags.push_back(std::make_shared<XMLTag>(tag));
176 "Vector attribute \"{}\" of tag <{}> is {}D, "
177 "which does not match the dimension of the {}D precice-configuration.",
323 if (
not ns.empty()) {
331 if (tag->getNamespace().empty()) {
332 PRECICE_ERROR(
"Tag <{}> was not found but is required to occur at least once.", tag->getName());
334 PRECICE_ERROR(
"Tag <{}:... > was not found but is required to occur at least once.", tag->getNamespace());
369 tag->_configured =
false;
370 tag->resetAttributes();
#define PRECICE_ERROR(...)
#define PRECICE_DEBUG(...)
#define PRECICE_TRACE(...)
#define PRECICE_CHECK(check,...)
#define PRECICE_ASSERT(...)
#define PRECICE_UNREACHABLE(...)
T back_inserter(T... args)
This class provides a lightweight logger.
const ATTRIBUTE_T & getValue() const
const std::string & getName() const
Represents an XML tag to be configured automatically.
Eigen::VectorXd getEigenVectorXdAttributeValue(const std::string &name, int dimensions) const
Returns Eigen vector attribute value with given dimensions.
std::string _fullName
Combination of name and namespace: _namespace + ":" + _name.
AttributeMap< double > _doubleAttributes
std::map< std::string, bool > _configuredNamespaces
bool hasAttribute(const std::string &attributeName)
std::string getStringAttributeValue(const std::string &name, std::optional< std::string > default_value=std::nullopt) const
bool getBooleanAttributeValue(const std::string &name, std::optional< bool > default_value=std::nullopt) const
AttributeMap< std::string > _stringAttributes
void readAttributes(const std::map< std::string, std::string > &aAttributes)
reads all attributes of this tag
XMLTag & setDocumentation(const std::string &documentation)
Adds a description of the purpose of this XML tag.
std::string _namespace
XML namespace of the tag.
void clear()
Removes all attributes and subtags.
std::set< std::string > _attributes
static std::string getOccurrenceString(Occurrence occurrence)
const std::string & getFullName() const
Returns full name consisting of xml namespace + ":" + name.
Occurrence
Types of occurrences of an XML tag.
AttributeMap< int > _intAttributes
void addAttributeHint(std::string name, std::string message)
Adds a hint for missing attributes, which will be displayed along the error message.
XMLTag(Listener &listener, std::string name, Occurrence occurrence, std::string xmlNamespace="")
Standard constructor.
std::map< std::string, std::string > _attributeHints
std::string _name
Name of the tag.
int getIntAttributeValue(const std::string &name, std::optional< int > default_value=std::nullopt) const
XMLTag & addNamespace(const std::string &namespaceName)
Adds a namespace to the tag.
AttributeMap< bool > _booleanAttributes
double getDoubleAttributeValue(const std::string &name, std::optional< double > default_value=std::nullopt) const
XMLTag & addAttribute(const XMLAttribute< double > &attribute)
Removes the XML subtag with given name.
XMLTag & addSubtag(const XMLTag &tag)
Adds an XML tag as subtag by making a copy of the given tag.
void areAllSubtagsConfigured() const
AttributeMap< Eigen::VectorXd > _eigenVectorXdAttributes
bool contained(const ELEMENT_T &element, const std::vector< ELEMENT_T > &vec)
Returns true, if given element is in vector, otherwise false.
std::vector< StringMatch > computeMatches(std::string_view given, const Container &expected)
contains the XML configuration parser.
XMLTag getRootTag()
Returns an XMLTag::Listener that does nothing on callbacks.
void configure(XMLTag &tag, const precice::xml::ConfigurationContext &context, std::string_view configurationFilename)
Configures the given configuration from file configurationFilename.
static precice::logging::Logger _log("precicec")
Tightly coupled to the parameters of Participant()
No operation listener for tests.
Callback interface for configuration classes using XMLTag.