1#ifndef TAG_PARSER_TAGFIELD_H
2#define TAG_PARSER_TAGFIELD_H
8template <
class implementationType>
class TagField;
16template <
typename ImplementationType>
class TagFieldTraits {};
75 bool m_typeInfoAssigned;
77 std::vector<ImplementationType> m_nestedFields;
83template <
class ImplementationType>
88 , m_typeInfoAssigned(false)
96template <
class ImplementationType>
101 , m_typeInfoAssigned(false)
134 return ImplementationType::fieldIdToString(m_id);
182 static_cast<ImplementationType *
>(
this)->internallyClearValue();
198 m_typeInfo = typeInfo;
199 m_typeInfoAssigned =
true;
208 m_typeInfoAssigned =
false;
216 return m_typeInfoAssigned;
232 m_default = isDefault;
242 static_cast<ImplementationType *
>(
this)->internallyClearFurtherData();
244 m_typeInfoAssigned =
false;
256 return static_cast<ImplementationType *
>(
this)->isAdditionalTypeInfoUsed();
264 return m_nestedFields;
274 return m_nestedFields;
282 return static_cast<ImplementationType *
>(
this)->supportsNestedFields();
291 m_value.clearDataAndMetadata();
Defines traits for the specified ImplementationType.
The TagField class is used by FieldMapBasedTag to store the fields.
void clearId()
Clears the id of the current TagField.
TagField()
Constructs an empty TagField.
~TagField()
Destroys the TagField.
void internallyClearValue()
Clears the assigned value; called via clearValue() and clear().
bool supportsNestedFields() const
Returns whether nested fields are supported by the implementation.
std::vector< ImplementationType > & nestedFields()
Returns the nested fields.
void setTypeInfo(const TypeInfoType &typeInfo)
Sets the type info of the current TagField.
const TagValue & value() const
Returns the value of the current TagField.
typename TagFieldTraits< ImplementationType >::IdentifierType IdentifierType
const TypeInfoType & typeInfo() const
Returns the type info of the current TagField.
void clear()
Clears id, value, type info, sets default flag to false and resets further implementation specific va...
void setDefault(bool isDefault)
Sets whether the field is labeled as default.
IdentifierType & id()
Returns the id of the current TagField.
const IdentifierType & id() const
Returns the id of the current TagField.
bool isTypeInfoAssigned() const
Returns an indication whether a type info is assigned.
void internallyClearFurtherData()
Clears further data; called via clear().
const std::vector< ImplementationType > & nestedFields() const
Returns the nested fields.
void setValue(const TagValue &value)
Sets the value of the current TagField.
void removeTypeInfo()
Removes the type info from the current TagField.
void setId(const IdentifierType &id)
Sets the id of the current Tag Field.
bool isDefault() const
Returns an indication whether the field is labeled as default.
std::string idToString() const
Returns the id of the current TagField as string.
bool isAdditionalTypeInfoUsed() const
Returns an indication whether the additional type info is used.
typename TagFieldTraits< ImplementationType >::TypeInfoType TypeInfoType
TagField(const IdentifierType &id, const TagValue &value)
Constructs a new TagField with the specified id and value.
void clearValue()
Clears the value of the current TagField.
TagValue & value()
Returns the value of the current TagField.
The TagValue class wraps values of different types.
#define TAG_PARSER_EXPORT
Marks the symbol to be exported by the tagparser library.
Contains all classes and functions of the TagInfo library.