Concept FiniteOrderedAlphabetConcept
An type that is of finite domain and totally ordered and thus has a minimum and maximum value.

Extends OrderedAlphabetConcept
All Extended AlphabetConcept, AssignableConcept, ComparableConcept, CopyConstructibleConcept, DefaultConstructibleConcept, EqualityComparableConcept, LessThanComparableConcept, OrderedAlphabetConcept
Defined in <seqan/basic.h>
Signature

Member Function Overview

Member Functions Inherited From AssignableConcept

Member Functions Inherited From ComparableConcept

Member Functions Inherited From EqualityComparableConcept

Member Functions Inherited From LessThanComparableConcept

Member Functions Inherited From OrderedAlphabetConcept

Interface Function Overview

Interface Functions Inherited From AssignableConcept

Interface Functions Inherited From ComparableConcept

Interface Functions Inherited From OrderedAlphabetConcept

Interface Metafunction Overview

Interface Metafunctions Inherited From AlphabetConcept

Interface Metafunctions Inherited From OrderedAlphabetConcept

Interface Functions Detail

T ordValue(value);

Maps an alphabet 1-to-1 to the interval [0..ValueSize).

Parameters

value Arbitrary character value. Types: SimpleType

Returns

T An unsigned value (result of Size<typeof(value)> between 0 and ValueSize of the type of value.

This function first converts value to its unsigned value type and after that to an unsigned int. You can't use (unsigned int)c for a character c as on some systems char is signed and a -1 would be mapped to 0xffffffff instead of 0x000000ff.

Data Races

Thread safety unknown!

T1 valueSize<T2>();

Returns size of an alphabet.

Template Parameters

T2 Type to query for value size.

Returns

T1 Number of values in type T2.

Data Races

Thread safety unknown!

See Also

Interface Metafunctions Detail

ValueSize<T>::Type; ValueSize<T>::VALUE;

Number of different values a value type object can have.

Template Parameters

T A type to query for its value size.

Returns

VALUE The number of different values a value of type T can have. The type is Type.
Type The type of the result VALUE.

This function is only defined for integral types like unsigned, int, or Dna. For floating point numbers and the 64 bit types int64_t and uint64_t, it returns 0 since there is no standard compliant way to return the number of values for these types.

Note that you cannot get pointers or references to ValueSize<T>::VALUE in your program. You can use valueSize in your programs without problems, though. When you get problems in your tests, use the "unary plus" workaround from the examples section.

Examples

The temporary assignment workaround.

SEQAN_ASSERT_EQ(ValueSize<bool>::VALUE, 2u);    // Linker error.
SEQAN_ASSERT_EQ(+ValueSize<bool>::VALUE, 2u);   // OK
SEQAN_ASSERT_EQ(valueSize<bool>(), 2u);         // OK