aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/plugins/pluginbackend.h
blob: 898b3a9949d5810705a8685cf4ea32e8c21209b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include "plugin_abi.h"
#include "shared/gamepresence.h"

#include <queue>
#include <mutex>

enum PluginDataRequestType
{
	END = 0,
};

union PluginRespondDataCallable
{
	// Empty for now
	void* UNUSED;
};

class PluginDataRequest
{
  public:
	PluginDataRequestType type;
	PluginRespondDataCallable func;
	PluginDataRequest(PluginDataRequestType type, PluginRespondDataCallable func) : type(type), func(func) {}
};

class PluginCommunicationHandler
{
  public:
	void RunFrame();
	void PushRequest(PluginDataRequestType type, PluginRespondDataCallable func);

	void GeneratePresenceObjects();

  public:
	std::queue<PluginDataRequest> requestQueue;
	std::mutex requestMutex;

	PluginEngineData m_sEngineData {};
};

void init_plugincommunicationhandler();

extern PluginCommunicationHandler* g_pPluginCommunicationhandler;