142 template <
typename Container>
This class provides a lightweight logger.
Represents an XML tag to be configured automatically.
const std::string & getNamespace() const
Returns xml namespace.
bool isConfigured() const
void addSubtags(const Container &subtags)
Eigen::VectorXd getEigenVectorXdAttributeValue(const std::string &name, int dimensions) const
Returns Eigen vector attribute value with given dimensions.
std::string getDocumentation() const
std::string _fullName
Combination of name and namespace: _namespace + ":" + _name.
const AttributeMap< Eigen::VectorXd > & getEigenVectorXdAttributes() const
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
Occurrence getOccurrence() const
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.
typename std::vector< std::string > Namespaces
std::string _namespace
XML namespace of the tag.
void clear()
Removes all attributes and subtags.
typename std::map< std::string, XMLAttribute< T > > AttributeMap
const Namespaces & getNamespaces() const
std::set< std::string > _attributes
const AttributeMap< std::string > & getStringAttributes() const
const AttributeMap< int > & getIntAttributes() const
const std::string & getName() const
Returns name (without namespace).
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.
typename std::vector< std::shared_ptr< XMLTag > > Subtags
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.
const Subtags & getSubtags() const
const AttributeMap< double > & getDoubleAttributes() const
AttributeMap< bool > _booleanAttributes
double getDoubleAttributeValue(const std::string &name, std::optional< double > default_value=std::nullopt) const
const AttributeMap< bool > & getBooleanAttributes() 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
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.
Main namespace of the precice library.
Tightly coupled to the parameters of Participant()
No operation listener for tests.
void xmlTagCallback(ConfigurationContext const &context, XMLTag &callingTag) override
Callback at begin of XML tag.
void xmlEndTagCallback(ConfigurationContext const &context, XMLTag &callingTag) override
Callback at end of XML tag and at end of subtag.
Callback interface for configuration classes using XMLTag.
virtual void xmlTagCallback(ConfigurationContext const &context, XMLTag &callingTag)=0
Callback at begin of XML tag.
Listener & operator=(Listener &&)=delete
virtual void xmlEndTagCallback(ConfigurationContext const &context, XMLTag &callingTag)=0
Callback at end of XML tag and at end of subtag.