-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontainers.h
66 lines (57 loc) · 2.4 KB
/
containers.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
63
64
65
66
//
// This file is part of dingo project <https://github.com/romanpauk/dingo>
//
// See LICENSE for license and copyright information
// SPDX-License-Identifier: MIT
//
#pragma once
#include <dingo/container.h>
#include <dingo/rtti/static_type_info.h>
#include <dingo/rtti/typeid_type_info.h>
#include <dingo/type_cache.h>
#include <dingo/type_map.h>
template <typename Tag = void>
struct static_container_with_dynamic_rtti_traits {
template <typename TagT>
using rebind_t = static_container_with_dynamic_rtti_traits<TagT>;
using tag_type = Tag;
using rtti_type = dingo::typeid_type_info;
template <typename Value, typename Allocator>
using type_map_type = dingo::static_type_map<Value, Tag, Allocator>;
template <typename Value, typename Allocator>
using type_cache_type = dingo::static_type_cache<Value, Tag, Allocator>;
using allocator_type = dingo::static_allocator<char, Tag>;
using index_definition_type = std::tuple<>;
static constexpr bool cache_enabled = true;
};
template <typename Tag = void>
struct static_container_without_cache : dingo::static_container_traits<> {
template <typename TagT>
using rebind_t = static_container_without_cache<TagT>;
static constexpr bool cache_enabled = false;
using tag_type = Tag;
};
struct dynamic_container_with_static_rtti_traits {
template <typename>
using rebind_t = dynamic_container_with_static_rtti_traits;
using tag_type = void;
using rtti_type = dingo::static_type_info;
template <typename Value, typename Allocator>
using type_map_type = dingo::dynamic_type_map<Value, rtti_type, Allocator>;
template <typename Value, typename Allocator>
using type_cache_type =
dingo::dynamic_type_cache<Value, rtti_type, Allocator>;
using allocator_type = std::allocator<char>;
using index_definition_type = std::tuple<>;
static constexpr bool cache_enabled = true;
};
struct dynamic_container_without_cache : dingo::dynamic_container_traits {
static constexpr bool cache_enabled = true;
};
using container_types = ::testing::Types<
dingo::container<dingo::static_container_traits<>>,
dingo::container<dingo::dynamic_container_traits>,
dingo::container<static_container_with_dynamic_rtti_traits<>>,
dingo::container<static_container_without_cache<>>,
dingo::container<dynamic_container_with_static_rtti_traits>,
dingo::container<dynamic_container_without_cache>>;