-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstance.h
46 lines (37 loc) · 844 Bytes
/
Instance.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
#ifndef BaseLib_Policy_Instance_h_IsIncluded
#define BaseLib_Policy_Instance_h_IsIncluded
#include"BaseLib/Templates/BaseTypes.h"
#include"BaseLib/Export.h"
namespace BaseLib { namespace Policy
{
namespace InstanceKind
{
enum class DLL_STATE Type : char
{
SINGLETON,
INSTANCES
};
}
class DLL_STATE Instance : public Templates::ComparableImmutableType<InstanceKind::Type>
{
public:
Instance(InstanceKind::Type type)
: Templates::ComparableImmutableType<InstanceKind::Type>(type)
{ }
~Instance()
{ }
InstanceKind::Type Kind()
{
return this->Clone();
}
static Instance Singleton()
{
return Instance(InstanceKind::Type::SINGLETON);
}
static Instance Instances()
{
return Instance(InstanceKind::Type::INSTANCES);
}
};
}}
#endif