Class Holder
Manages relationship to another object.

All Subcl's SimpleHolder, TristateHolder
Defined in <seqan/basic.h>
Signature template <typename TValue[, typename TSpec> class Holder;

Template Parameters

TSpec The specializing type. Default: Tristate
TValue Type of the managed object.

Interface Function Overview

Interface Metafunction Overview

Detailed Description

Remarks

The main purpose of this class is to facilitate the handling of member objects. If we want class A to be dependent on or the owner of another object of class B, then we add a data member of type Holder<B> to A. Holder offers some useful access functions and stores the kind of relationship between A and B.

See Also

Interface Functions Detail

void assignValue(object, value);

Assigns value to item.

Parameters

object An object that holds a value or points to a value. Types: Holder, Iter Concepts: Concept.BasicOutputIteratorConcept
value A value that is assigned to the item object holds or points to.

This function is similar to assign. The difference is, that assignValue just changes a value stored in object or the value object points to, while assign changes the whole object.

If object is a container (that is pos is not specified), the whole content of object is replaced by value.

If value is not used again after calling this function, then consider to use moveValue that could be faster in some cases instead.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

See Also

void clear(holder);

Clear/destruct the Holder's value.

Parameters

holder The Holder to clear.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

void create(holder[, object]);

Makes an object to owner of its content.

Parameters

holder The Holder to create the object of.
object Object from which a copy is made and stored in holder.

After this operation, holder will be in state 'owner'. If object is specified, holder will hold a copy of object at the end of this function. If object is not specified, the action depends on the former state of holder:

  • If the state of holder was 'empty', a new object is default constructed and stored into holder.
  • If the state of holder was 'dependent', a copy of the former object is made and stored into holder.
  • If the state of holder was already 'owner', nothing happens.

It is guaranteed, that after calling this function source and target can be used independently.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

void detach(holder);

Makes an object independent from other objects.

Parameters

holder The Holder to detach.

Remarks

After this function, holder does not depends from any other entity outside of holder, like a source or a host, and dependent(holer) returns false

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

bool empty(holder);

Test a Holder for being empty.

Parameters

holder A Holder.

Returns

bool true if holder contains no elements, otherwise false.

Remarks

empty(x) is guaranteed to be at least as fast as length(me) == 0, but can be significantly faster in some cases.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

See Also

TGetValue getValue(holder);

Return the get-value of the holder.

Parameters

holder The Holder to query for its get-value type.

Returns

TGetValue The get-value of the Holder.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

void moveValue(holder, value);

Move a value of into a holder.

Parameters

holder The Holder to manipulate.
value The value to move into holder.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

void setValue(holder, object);

Makes holder dependent.

Parameters

holder A holder object. Types: Holder
object Object from which holder will be dependent.

After this operation, holder will be dependent in state 'dependent'.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

TReference value(holder);

Return a reference to the value of the holder.

Parameters

holder The Holder to query for its reference.

Returns

TReference The reference of the Holder's value.

Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

Interface Metafunctions Detail

GetValue<THolder>::Type;

Return get-value type of Holder.

Template Parameters

THolder The Holder to query for its value type.

Returns

Type The get-value type for its holder.

Reference<THolder>::Type;

Return the reference type of a Holder.

Template Parameters

THolder The holder to query for its reference type.

Returns

Type The resulting reference type.

Spec<THolder>::Type;

Return the specialization tag for a Holder.

Template Parameters

THolder The Holder to query for its value type.

Returns

Type The resulting specialization tag.

Value<THolder>::Type;

Return value type of Holder.

Template Parameters

THolder The Holder to query for its value type.

Returns

Type The value type for its holder.