isle/LEGO1/mxstreamlist.h
Misha cb8c143ce5
Finish MxDiskStreamController methods (#359)
* more mxdiskstreamcontroller methods

* further debugging and fixes

* add more functions

* Update mxdiskstreamprovider.cpp

* fix build

* implement MxDiskStreamProvider::PerformWork

* Update mxdiskstreamprovider.cpp

* Update mxdiskstreamprovider.cpp

* Update mxdssource.h

* remove debug prints

* Update mxdiskstreamprovider.cpp

* Mostly match MxDiskStreamController::FUN_100c8540

* Mostly match MxDiskStreamProvider::FUN_100d1780

* Mostly match MxDiskStreamProvider::PerformWork

* Fixes

* Retype some members

* Various annotations

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-12-25 19:32:01 +01:00

50 lines
1 KiB
C++

#ifndef MXSTREAMLIST_H
#define MXSTREAMLIST_H
#include "mxdsstreamingaction.h"
#include "mxdssubscriber.h"
#include "mxnextactiondatastart.h"
#include "mxstl/stlcompat.h"
template <class T>
class MxStreamList : public list<T> {
public:
MxBool PopFront(T& p_obj)
{
if (empty())
return FALSE;
p_obj = front();
pop_front();
return TRUE;
}
};
// SIZE 0xc
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;
}
};
// SIZE 0xc
class MxStreamListMxNextActionDataStart : public MxStreamList<MxNextActionDataStart*> {
public:
MxNextActionDataStart* Find(MxU32, MxS16);
};
// SIZE 0xc
class MxStreamListMxDSSubscriber : public MxStreamList<MxDSSubscriber*> {};
#endif // MXSTREAMLIST_H