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

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

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.
Member of
std::basic_string, std::vector, thrust::device_vector, Segment, String
Examples
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 - www.seqan.de

Page built @2014/10/13 16:12:58