Template Class EntityWithMetadata

Inheritance Relationships

Base Type

Derived Type

Class Documentation

template<typename T>
class EntityWithMetadata : public nix::base::NamedEntity<T>

Base class for entities that can be associated with additional metadata.

The data part of the NIX data model consists of five main elements which all inherit from nix::base::EntityWithMetadata: nix::Block, nix::DataArray, nix::MultiTag, nix::Tag, and nix::Source that serve different purposes. Common to all those entities is an optional property metadata which provides a link to a nix::Section entity and therefore makes it possible to annotate the entities with additional metadata.

Subclassed by nix::base::EntityWithSources< T >

Public Functions

inline EntityWithMetadata()

Constructor that creates a null entity.

inline EntityWithMetadata(const std::shared_ptr<T> &p_impl)

Constructor that creates a new entity from a shared pointer to an implementation instance.

inline EntityWithMetadata(std::shared_ptr<T> &&ptr)

Constructor with move semantics that creates a new entity from a shared pointer to an implementation instance.

inline Section metadata() const

Get metadata associated with this entity.

Returns

The associated section, if no such section exists an uninitialized nix::Section will be returned.

inline void metadata(const Section &metadata)

Associate the entity with some metadata.

Calling this method will replace previously stored information.

Parameters

metadata – The nix::Section that should be associated with this entity.

inline void metadata(const std::string &id)

Associate the entity with some metadata.

Calling this method will replace previously stored information.

Parameters

id – The id of the nix::Section that should be associated with this entity.

inline void metadata(const none_t t)

Remove associated metadata from the entity.

This method just removes the association between the respective nix::Section but will not remove it from the file.

Parameters

t – None

inline virtual ~EntityWithMetadata()

Destructor