-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpch.h
62 lines (50 loc) · 1.17 KB
/
pch.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
60
61
62
#pragma once
#include <concepts>
#include <functional>
#include <string>
#include <filesystem>
#include <type_traits>
#include <filesystem>
#include <exception>
#include <stdexcept>
#include <iostream>
#include <memory>
#include <map>
#include <typeinfo>
#include <typeindex>
#include "IAdapter.h"
#pragma region Concepts
template <typename T>
concept IsAdapterConfiguration = std::is_object_v<T>;
template<typename T>
concept InAndOutAdapter = requires(T t, IAdapterConfig & config)
{
t.Init(config);
t.Start();
};
#pragma endregion
#pragma region Enums
enum class MessageTypes
{
MsgTyp1 = 0,
MsgTyp2 = 1
};
enum class LogLevels {
Info,
Warn,
Error,
Fatal
};
#pragma endregion
#pragma region Usings
//Standard string
using String = std::string;
//Shared pointer to IAdapter - the base class of all adapters
using AdapterPtr = std::shared_ptr<IAdapter>;
//Functor to an instance of IAdapter
using IAdapterFunctor = std::function<AdapterPtr()>;
//List of functors used a s a central adapter registration list
using AdapterFunctorMap = std::map<std::string, IAdapterFunctor>;
//List with instances to ech adapter
using AdapterPtrMap = std::map<String, AdapterPtr>;
#pragma endregion