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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
#ifndef Subsystem_Package_dummy_helpers_h
#define Subsystem_Package_dummy_helpers_h
// -*- C++ -*-
//
// Package: Subsystem/Package
// Class : dummy_helpers
//
/**\class dummy_helpers dummy_helpers.h "dummy_helpers.h"
Description: [one line class summary]
Usage:
<usage>
*/
//
// Original Author: Chris Jones
// Created: Sat, 03 Aug 2013 21:42:38 GMT
//
// system include files
#include <memory>
#include <vector>
#include <mutex>
// user include files
// forward declarations
namespace edm {
namespace stream {
namespace impl {
struct dummy_ptr {
void* get() { return nullptr; }
void reset(void*) {}
void* release() { return nullptr; }
};
struct dummy_vec {
void resize(size_t) {}
dummy_ptr operator[](unsigned int) { return dummy_ptr(); }
};
struct dummy_mutex {
void lock() {}
void unlock() {}
};
template <typename T>
struct choose_unique_ptr {
typedef std::unique_ptr<T> type;
};
template <>
struct choose_unique_ptr<void> {
typedef dummy_ptr type;
};
template <>
struct choose_unique_ptr<void const> {
typedef dummy_ptr type;
};
template <typename T>
struct choose_shared_vec {
typedef std::vector<std::shared_ptr<T>> type;
};
template <>
struct choose_shared_vec<void> {
typedef dummy_vec type;
};
template <>
struct choose_shared_vec<void const> {
typedef dummy_vec type;
};
template <typename T>
struct choose_mutex {
using type = std::mutex;
};
template <>
struct choose_mutex<void> {
using type = dummy_mutex;
};
} // namespace impl
} // namespace stream
} // namespace edm
#endif
|