Isle
Loading...
Searching...
No Matches
mxutilitylist.h
Go to the documentation of this file.
1#ifndef MXUTILITYLIST_H
2#define MXUTILITYLIST_H
3
4#include "mxstl/stlcompat.h"
5
6// Probably should be defined somewhere else
7
13template <class T>
14class MxUtilityList : public list<T> {
15public:
22 MxBool PopFront(T& p_obj)
23 {
24 if (this->empty()) {
25 return FALSE;
26 }
27
28 p_obj = this->front();
29 this->pop_front();
30 return TRUE;
31 }
32
38 void PushBack(T p_obj) { this->push_back(p_obj); }
39
45 void Remove(T p_obj) { this->remove(p_obj); }
46};
47
48#endif // MXUTILITYLIST_H
[AI] A utility list extending the STL list<T>, providing simplified PushBack, Remove,...
Definition: mxutilitylist.h:14
void PushBack(T p_obj)
[AI] Pushes a copy of the provided object to the back of the list.
Definition: mxutilitylist.h:38
MxBool PopFront(T &p_obj)
[AI] Removes and returns the first element of the list.
Definition: mxutilitylist.h:22
void Remove(T p_obj)
[AI] Removes all matching objects from the list.
Definition: mxutilitylist.h:45
#define TRUE
Definition: d3drmdef.h:28
#define FALSE
Definition: d3drmdef.h:27
#define list
[AI] Macro alias for List<T>, replacing std::list<T>.
Definition: mxstl.h:410
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
[AI] STL compatibility layer header to provide consistent STL (Standard Template Library) types and a...