mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-21 07:11:16 +00:00
Move definitions out of class body
This commit is contained in:
parent
68ac78ae03
commit
eadacf4e04
@ -75,44 +75,9 @@ class MxListCursor : public MxCore
|
||||
m_match = NULL;
|
||||
}
|
||||
|
||||
MxBool Find(T *p_obj) {
|
||||
for (m_match = m_list->m_first;
|
||||
m_match && m_list->Compare(m_match->m_obj, p_obj);
|
||||
m_match = m_match->m_next);
|
||||
|
||||
return m_match != NULL;
|
||||
}
|
||||
|
||||
void Detach() {
|
||||
MxListEntry<T> *m_prev = m_match->m_prev;
|
||||
MxListEntry<T> *m_next = m_match->m_next;
|
||||
|
||||
if (m_prev)
|
||||
m_prev->m_next = m_next;
|
||||
else
|
||||
m_list->m_first = m_next;
|
||||
|
||||
if (m_next)
|
||||
m_next->m_prev = m_prev;
|
||||
else
|
||||
m_list->m_last = m_prev;
|
||||
|
||||
delete m_match;
|
||||
m_list->m_count--;
|
||||
m_match = NULL;
|
||||
}
|
||||
|
||||
MxBool Next(T*& p_obj) {
|
||||
if (!m_match)
|
||||
m_match = m_list->m_first;
|
||||
else
|
||||
m_match = m_match->m_next;
|
||||
|
||||
if (m_match)
|
||||
p_obj = m_match->m_obj;
|
||||
|
||||
return m_match != NULL;
|
||||
}
|
||||
MxBool Find(T *p_obj);
|
||||
void Detach();
|
||||
MxBool Next(T*& p_obj);
|
||||
private:
|
||||
MxList<T> *m_list;
|
||||
MxListEntry<T> *m_match;
|
||||
@ -170,4 +135,49 @@ inline void MxList<T>::Append(T *p_newobj)
|
||||
this->m_count++;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline MxBool MxListCursor<T>::Find(T *p_obj)
|
||||
{
|
||||
for (m_match = m_list->m_first;
|
||||
m_match && m_list->Compare(m_match->m_obj, p_obj);
|
||||
m_match = m_match->m_next);
|
||||
|
||||
return m_match != NULL;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void MxListCursor<T>::Detach()
|
||||
{
|
||||
MxListEntry<T> *m_prev = m_match->m_prev;
|
||||
MxListEntry<T> *m_next = m_match->m_next;
|
||||
|
||||
if (m_prev)
|
||||
m_prev->m_next = m_next;
|
||||
else
|
||||
m_list->m_first = m_next;
|
||||
|
||||
if (m_next)
|
||||
m_next->m_prev = m_prev;
|
||||
else
|
||||
m_list->m_last = m_prev;
|
||||
|
||||
delete m_match;
|
||||
m_list->m_count--;
|
||||
m_match = NULL;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline MxBool MxListCursor<T>::Next(T*& p_obj)
|
||||
{
|
||||
if (!m_match)
|
||||
m_match = m_list->m_first;
|
||||
else
|
||||
m_match = m_match->m_next;
|
||||
|
||||
if (m_match)
|
||||
p_obj = m_match->m_obj;
|
||||
|
||||
return m_match != NULL;
|
||||
}
|
||||
|
||||
#endif // MXLIST_H
|
||||
Loading…
Reference in New Issue
Block a user