isle-portable/LEGO1/omni/include/mxstreamlist.h

55 lines
1.2 KiB
C
Raw Normal View History

2023-11-28 08:26:39 -05:00
#ifndef MXSTREAMLIST_H
#define MXSTREAMLIST_H
#include "mxdsstreamingaction.h"
2023-11-28 08:26:39 -05:00
#include "mxdssubscriber.h"
#include "mxnextactiondatastart.h"
2023-12-11 16:33:46 -05:00
#include "mxstl/stlcompat.h"
2023-11-28 08:26:39 -05:00
template <class T>
class MxStreamList : public list<T> {
public:
MxBool PopFront(T& p_obj)
{
if (this->empty())
return FALSE;
p_obj = this->front();
this->pop_front();
return TRUE;
}
};
2023-11-28 08:26:39 -05:00
// SIZE 0x0c
2023-11-28 08:26:39 -05:00
class MxStreamListMxDSAction : public MxStreamList<MxDSAction*> {
public:
MxDSAction* Find(MxDSAction* p_action, MxBool p_delete);
// There chance this list actually holds MxDSStreamingListAction
// instead of MxDSAction. Until then, we use this helper.
MxBool PopFrontStreamingAction(MxDSStreamingAction*& p_obj)
{
if (empty())
return FALSE;
p_obj = (MxDSStreamingAction*) front();
pop_front();
return TRUE;
}
2023-11-28 08:26:39 -05:00
};
// SIZE 0x0c
2023-11-28 08:26:39 -05:00
class MxStreamListMxNextActionDataStart : public MxStreamList<MxNextActionDataStart*> {
public:
MxNextActionDataStart* Find(MxU32 p_id, MxS16 p_value);
MxNextActionDataStart* FindAndErase(MxU32 p_id, MxS16 p_value);
2023-11-28 08:26:39 -05:00
};
// SIZE 0x0c
class MxStreamListMxDSSubscriber : public MxStreamList<MxDSSubscriber*> {
public:
MxDSSubscriber* Find(MxDSObject* p_object);
};
2023-11-28 08:26:39 -05:00
#endif // MXSTREAMLIST_H