Function
id
A value that identifies the underlying sequence.
void const * id(object)
Include Headers
seqan/sequence.h
Parameters

object | The object for which the id will be determined. Types: Gaps, Segment, std::basic_string, std::vector, String

Remarks
Two sequences should have the same id, if they share the same resource, e.g. the same memory buffer.
The exact semantic of the returned id can vary for different classes. Typically, the id of a string is a void const * to the end of the string.
Note: The id of a single character need not to be the id of its container.
Return Values
The id of sequence.
Examples
String<char> str = "hallo seqan";
bool b1 = (id(str) == id(infix(str, 3, 7)); //true
bool b2 = (id(str) == id(String<char>(str))); //false
bool b3 = (id(str) == id(toCString(str)));
In this example, b1 is true, since the segment object returned by infix() is just a filter and uses the buffer of it's host object str.
String<char>(str) constructs a temporary copy of str, so these two strings have different id values.
The result of the last comparison depends on the implementation of toCString and cannot be predicted at compile time.
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2012/03/14 16:34:47