/
iradiant.h
59 lines (46 loc) · 1.1 KB
/
iradiant.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#pragma once
#include "imodule.h"
#include <sigc++/signal.h>
#include <functional>
const char* const MODULE_RADIANT("Radiant");
namespace applog { class ILogWriter; }
namespace radiant
{
/**
* Main application host
*/
class IRadiant
{
public:
typedef std::shared_ptr<IRadiant> Ptr;
/**
* Central logging class of the module. Use this to
* attach your own ILogDevices to receive logging output.
*/
virtual applog::ILogWriter& getLogWriter() = 0;
virtual ~IRadiant() {}
};
}
/**
* \brief
* Interface to the core application.
*/
class IRadiantBase :
public RegisterableModule
{
public:
/// Signal emitted when main Radiant application is constructed
virtual sigc::signal<void> signal_radiantStarted() const = 0;
/// Signal emitted just before Radiant shuts down
virtual sigc::signal<void> signal_radiantShutdown() const = 0;
};
inline IRadiantBase& GlobalRadiant()
{
// Cache the reference locally
static IRadiantBase& _radiant(
*std::static_pointer_cast<IRadiantBase>(
module::GlobalModuleRegistry().getModule(MODULE_RADIANT)
)
);
return _radiant;
}