sead
Loading...
Searching...
No Matches
seadMessageQueue.h
Go to the documentation of this file.
1#ifndef SEAD_MESSAGE_QUEUE_H_
2#define SEAD_MESSAGE_QUEUE_H_
3
4#include <basis/seadTypes.h>
5
6#ifdef cafe
7#include <cafe/os/OSMessage.h>
8#endif // cafe
9
10namespace sead {
11
12class Heap;
13
15{
16public:
18 {
19 cBlock = 0,
21 };
22
23 typedef s32 Element;
24
25 static const Element cNullElement;
26
27public:
30
31 void allocate(s32 size, Heap* heap);
32 void free();
33
34 bool push(Element message, BlockType blockType);
35 Element pop(BlockType blockType);
36 Element peek(BlockType blockType) const;
37 bool jam(Element message, BlockType blockType);
38
39protected:
40#ifdef cafe
43#else
44#error "Unsupported platform"
45#endif
46};
47#ifdef cafe
48static_assert(sizeof(MessageQueue) == 0x40, "sead::MessageQueue size mismatch");
49#endif // cafe
50
51} // namespace sead
52
53#endif // SEAD_MESSAGE_QUEUE_H_
Definition seadHeap.h:23
Definition seadMessageQueue.h:15
bool push(Element message, BlockType blockType)
Element peek(BlockType blockType) const
Element pop(BlockType blockType)
s32 Element
Definition seadMessageQueue.h:23
BlockType
Definition seadMessageQueue.h:18
@ cNoBlock
Definition seadMessageQueue.h:20
@ cBlock
Definition seadMessageQueue.h:19
void allocate(s32 size, Heap *heap)
static const Element cNullElement
Definition seadMessageQueue.h:25
bool jam(Element message, BlockType blockType)
Definition seadAssert.h:44