Template Class NamedEntity

Inheritance Relationships

Base Type

Derived Type

Class Documentation

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

Base class for entities with a name, type and a definition.

In addition to the properties defined by nix::base::Entity most entities of the NIX data model further provide a name, type and a definition. The name of an entity serves as a human readable identifier. It is not obliged to be unique. However it is strongly recommended to use unique name inside one specific nix::Block. The property type is used in order to allow the specification of additional semantic meaning for an entity and therefore can introduce domain-specificity into the quite generic data model. The definition is an optional property that allows the user to add a freely assignable textual definition to the entity.

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

Public Functions

inline NamedEntity()

Constructor that creates a null entity.

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

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

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

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

inline void type(const std::string &type)

Setter for the type of the entity.

Parameters

type – The type to set.

inline std::string type() const

Getter for the type of the entity.

The property type is used in order to allow the specification of additional semantic meaning for an entity and therefore can introduce domain-specificity into the quite generic data model.

Returns

The current type.

inline std::string name() const

Getter for the name of the entity.

The name of an entity serves as a human readable identifier. It is not obliged to be unique. However it is strongly recommended to use unique name inside one specific nix::Block.

Returns

string The name of the entity.

inline void definition(const std::string &definition)

Setter for the definition of the entity.

Parameters

definition – The definition of the entity.

inline boost::optional<std::string> definition() const

Getter for the definition of the entity.

The definition is an optional property that allows the user to add a freely assignable textual definition to the entity.

Returns

The definition of the entity.

inline void definition(const none_t t)

Deleter for the definition of the entity.

inline int compare(NamedEntity &other) const

Compare two named entities.

Parameters

other – The entity to compare with.

Returns

> 0 if the entity is larger that other, 0 if both are equal, and < 0 otherwise.

inline virtual ~NamedEntity()

Destructor.