isle/LEGO1/omni/include/mxstreamlist.h

70 lines
1.6 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:
// FUNCTION: BETA10 0x10150e30
MxDSAction* FindAndErase(MxDSAction* p_action) { return FindInternal(p_action, TRUE); }
// FUNCTION: BETA10 0x10150fc0
MxDSAction* Find(MxDSAction* p_action) { return FindInternal(p_action, FALSE); }
// 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;
}
private:
MxDSAction* FindInternal(MxDSAction* p_action, MxBool p_delete);
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
// TEMPLATE: BETA10 0x10150950
// MxStreamList<MxDSAction *>::PopFront
// TEMPLATE: BETA10 0x10150a70
// MxStreamList<MxDSSubscriber *>::PopFront
2023-11-28 08:26:39 -05:00
#endif // MXSTREAMLIST_H