1 #ifndef TAG_PARSER_TAGFIELD_H
2 #define TAG_PARSER_TAGFIELD_H
8 template <
class implementationType>
class TagField;
75 bool m_typeInfoAssigned;
77 std::vector<ImplementationType> m_nestedFields;
83 template <
class ImplementationType>
88 , m_typeInfoAssigned(false)
96 template <
class ImplementationType>
101 , m_typeInfoAssigned(false)
123 return ImplementationType::fieldIdToString(m_id);
171 static_cast<ImplementationType *
>(
this)->internallyClearValue();
187 m_typeInfo = typeInfo;
188 m_typeInfoAssigned =
true;
197 m_typeInfoAssigned =
false;
205 return m_typeInfoAssigned;
221 m_default = isDefault;
231 static_cast<ImplementationType *
>(
this)->internallyClearFurtherData();
233 m_typeInfoAssigned =
false;
245 return static_cast<ImplementationType *
>(
this)->isAdditionalTypeInfoUsed();
253 return m_nestedFields;
263 return m_nestedFields;
271 return static_cast<ImplementationType *
>(
this)->supportsNestedFields();
280 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.
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
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.