Class Feature

Inheritance Relationships

Base Type

Class Documentation

class Feature : public nix::base::Entity<base::IFeature>

Feature entities are used to attach further data to a nix::Tag or nix::MultiTag

A Feature entity contains a link to an existing nix::DataArray containing additional data that belongs to the respective tag. The way how data and feature are connected is specified by the link type.

Tagged

This link type indicates, that only a certain subset of the linked nix::DataArray belongs to the Feature. This subset is defined by the position and extent of the respective tag.

Untagged

This implies that the whole data stored in the linked nix::DataArray belongs to the Feature.

Indexed

This value is only valid for multi tags where it indicates that the data linked via this Feature has to be accessed according to the index in the respective position entry.

Public Functions

inline Feature()

Constructor that creates an uninitialized Feature.

Calling any method on an uninitialized feature will throw a nix::UninitializedEntity exception. The following code illustrates how to check if a feature is initialized:

Feature e = ...;
if (e) {
    // e is initialised
} else {
    // e is uninitialized
}

inline Feature(const Feature &other)

Copy constructor.

Copying of all NIX front facing objects like Feature is a rather cheap operation. Semantically this is equivalent to the creation of another reference to the original object.

Parameters

other – The feature to copy.

inline Feature(const std::shared_ptr<base::IFeature> &p_impl)

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

This constructor should only be used in the back-end.

inline Feature(std::shared_ptr<base::IFeature> &&ptr)

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

This constructor should only be used in the back-end.

inline void linkType(LinkType type)

Setter for the link type.

Parameters

type – The link type to set.

inline LinkType linkType() const

Getter for the link type.

Returns

The current link type of the feature.

void data(const std::string &name_or_id)

Sets the data array associated with this feature.

Parameters

name_or_id – Name or id of the data array to set.

void data(const DataArray &data)

Sets the data array associated with this feature.

Parameters

data – The data array to set.

inline DataArray data() const

Gets the data array associated with this feature.

Returns

The associated data array.

inline virtual ~Feature()

Destructor.

inline Feature &operator=(const none_t &t)

Assignment operator for none.

inline Feature &operator=(const Feature &other)

Copy-assignment operator.