14 #include "messagefacility/MessageLogger/MessageLogger.h"
21 if (prevElement) prevElement->
AddNext(
this);
22 if (nextElement)
AddNext(nextElement);
27 if (prev) prev->RemoveNext(
this);
28 if (next) RemoveNext(next);
33 if (!nextElement || (nextElement ==
this))
return false;
35 if (next && (next->prev ==
this))
38 if (nextElement->
prev && (nextElement->
prev !=
this))
48 if (nextElement && (next == nextElement))
50 if (next->prev ==
this) next->prev = 0;
53 mf::LogError(
"pma::SortedObjectBase") <<
"Object structure is broken.";
66 while (next_vector.size()) RemoveNext(next_vector.front());
67 if (prev) prev->RemoveNext(
this);
74 mf::LogError(
"pma::SortedBranchBase") <<
"Next == 0.";
78 if (nextElement ==
this)
80 mf::LogWarning(
"pma::SortedBranchBase") <<
"Next == This.";
85 for (
size_t i = 0; i < next_vector.size(); i++)
87 if (next_vector[i] == nextElement)
89 mf::LogWarning(
"pma::SortedBranchBase") <<
"Contained.";
90 present =
true;
break;
95 if (nextElement->
prev)
100 next_vector.push_back(next);
108 if (!nextElement || (nextElement ==
this))
return -1;
111 for (
unsigned int i = 0; i < next_vector.size(); i++)
113 if (next_vector[i] == nextElement) { index = i;
break; }
117 if (next_vector[index]->prev !=
this)
119 mf::LogError(
"pma::SortedBranchBase") <<
"Object structure is broken.";
122 next_vector[index]->prev = 0;
123 next_vector.erase(next_vector.begin() + index);
125 if (next_vector.size() > 0) next = next_vector.back();
virtual bool AddNext(pma::SortedObjectBase *nextElement)
virtual int RemoveNext(pma::SortedObjectBase *nextElement)
pma::SortedObjectBase * prev
Implementation of the Projection Matching Algorithm.
virtual int RemoveNext(pma::SortedObjectBase *nextElement)
virtual void Disconnect(void)
virtual void Disconnect(void)
virtual bool AddNext(pma::SortedObjectBase *nextElement)