More implementation

This commit is contained in:
Christian Semmler
2023-10-19 18:10:11 -04:00
parent b77b3b3568
commit 2edc1fd961
2 changed files with 73 additions and 1 deletions

View File

@@ -88,7 +88,11 @@ public:
MxBool Find(T p_obj);
void Detach();
void Destroy();
MxBool Next(T& p_obj);
MxBool Current(T& p_obj);
void Advance();
MxListEntry<T> *GetMatch() { return m_match; }
void SetValue(T p_obj);
void Head() { m_match = m_list->m_first; }
void Reset() { m_match = NULL; }
@@ -209,6 +213,12 @@ inline void MxListCursor<T>::Detach()
m_match = NULL;
}
template <class T>
inline void MxListCursor<T>::Destroy()
{
m_list->m_customDestructor(m_match->GetValue());
}
template <class T>
inline MxBool MxListCursor<T>::Next(T& p_obj)
{
@@ -223,6 +233,24 @@ inline MxBool MxListCursor<T>::Next(T& p_obj)
return m_match != NULL;
}
template <class T>
inline MxBool MxListCursor<T>::Current(T& p_obj)
{
if (m_match)
p_obj = m_match->GetValue();
return m_match != NULL;
}
template <class T>
inline void MxListCursor<T>::Advance()
{
if (!m_match)
m_match = m_list->m_first;
else
m_match = m_match->m_next;
}
template <class T>
inline void MxListCursor<T>::SetValue(T p_obj)
{