Here's the callback function that I does insertion into list
Code:
bool MySearchCallback(String* id, void* arg)
{
Road *aRoad;
String roadname;
int segmentId, startVertex;
int success;
DbRead *wrapper;
wrapper = reinterpret_cast<DbRead*>(arg);
startVertex = -1;
for(int i=id->stringLength(); i>0; i--)
{
if( *(id->getChar(i)) == '_')
{
if(startVertex == -1)
{
startVertex = atoi(id->getChar(i+1));
}
else
{
segmentId = atoi(id->getChar(i+1));
roadname.setString(id->substr(0,i));
break;
}
}
}
aRoad = NULL;
success = wrapper->splayTree.retrieve(roadname,aRoad);
if(success)
wrapper->routeList.push_back(aRoad->getVertex(segmentId, startVertex));
return true; // keep going
}
There are suppose to be 28 items but only 14 entries are correct. The rest are '?'
DavidP, my list is a member of the DbRead class, which may experience the same problem as yours. How do I initialized it properly? Thanks.