-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShared.h
More file actions
54 lines (38 loc) · 1.74 KB
/
Copy pathShared.h
File metadata and controls
54 lines (38 loc) · 1.74 KB
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
// ===========================================================================
/// <summary>
/// Shared.h
/// DirectXIntroduction
/// created by Mehrdad Soleimanimajd on 30.07.2019
/// </summary>
/// <created>ʆϒʅ, 30.07.2019</created>
/// <changed>ʆϒʅ, 04.07.2023</changed>
// ===========================================================================
#ifndef SHARED_H
#define SHARED_H
//#define _NOT_DEBUGGING // shipping time definition
#include "Utilities.h"
// global:
extern bool running;
extern std::wstring gameState;
//template<class tType>
//static std::shared_ptr<tType> pointerEntity;
//static tType* get (); // generic locator
//static void provider ( std::shared_ptr<tType> ); // generic provider
class PointerProvider
{
private:
static std::shared_ptr<theException> exception; // shared pointer to exception class
static std::shared_ptr<Configurations> configuration; // shared pointer to configuration class
static std::shared_ptr<Logger<toFile>> fileLogger; // shared pointer to file logger class
public:
// smart shared pointers point to exceptions, provide extended lifetime and are passable across threads:
static std::exception_ptr exceptionPointer; // smart shared pointer-like type
static theException* getException (void); // exception locator
static Configurations* getConfiguration (void); // configuration locator
static Logger<toFile>* getFileLogger (void); // file logger locator
static void exceptionProvider (std::shared_ptr<theException>); // exception provider
static void configurationProvider (std::shared_ptr<Configurations>); // configuration provider
static void fileLoggerProvider (std::shared_ptr<Logger<toFile>>); // file logger provider
};
#endif // !SHARED_H