Enable logging a specified list of objects for generic robot logging.

This commit is contained in:
yunfeibai
2017-02-20 12:17:12 -08:00
parent a3c1fec171
commit e12981fd45
4 changed files with 55 additions and 4 deletions

View File

@@ -483,6 +483,22 @@ protected:
}
return index;
}
int findLinearSearch2(const T& key) const
{
int index=-1;
int i;
for (i=0;i<size();i++)
{
if (m_data[i] == key)
{
index = i;
break;
}
}
return index;
}
void remove(const T& key)
{

View File

@@ -475,6 +475,24 @@ protected:
}
return index;
}
// If the key is not in the array, return -1 instead of 0,
// since 0 also means the first element in the array.
int findLinearSearch2(const T& key) const
{
int index=-1;
int i;
for (i=0;i<size();i++)
{
if (m_data[i] == key)
{
index = i;
break;
}
}
return index;
}
void removeAtIndex(int index)
{