A value that identifies the underlying sequence.
void const * getObjectId(object)
Include Headers
The object for which the id will be determined.
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.
String<char> str = "hallo seqan";
bool b1 = (getObjectId(str) == getObjectId(infix(str, 3, 7));   //true
bool b2 = (getObjectId(str) == getObjectId(String<char>(str))); //false
bool b3 = (getObjectId(str) == getObjectId(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 -

Page built @2013/07/11 09:12:36