idlize
1#include <deque>
2#include "events.h"
3#include "Interop.h"
4
5std::deque<EventBuffer> eventQueue;
6
7void sendEvent(const EventBuffer* event) {
8eventQueue.push_back(*event);
9}
10
11KInt impl_CheckArkoalaGeneratedEvents(KByte* result, KInt size) {
12if (((size_t)size) < sizeof(EventBuffer::buffer))
13throw std::invalid_argument("Expected buffer size be not less than sizeof(EventBuffer) bytes");
14
15if (!eventQueue.size())
16return 0;
17
18memcpy(result, eventQueue.front().buffer, sizeof(EventBuffer::buffer));
19eventQueue.pop_front();
20return 1;
21}
22KOALA_INTEROP_2(CheckArkoalaGeneratedEvents, KInt, KByte*, KInt)