CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
dummy_helpers.h
Go to the documentation of this file.
1 #ifndef Subsystem_Package_dummy_helpers_h
2 #define Subsystem_Package_dummy_helpers_h
3 // -*- C++ -*-
4 //
5 // Package: Subsystem/Package
6 // Class : dummy_helpers
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sat, 03 Aug 2013 21:42:38 GMT
19 //
20 
21 // system include files
22 #include <memory>
23 #include <vector>
24 #include <mutex>
25 // user include files
26 
27 // forward declarations
28 
29 namespace edm {
30  namespace stream {
31  namespace impl {
32  struct dummy_ptr {
33  void* get() { return nullptr; }
34  void reset(void*) {}
35  void* release() { return nullptr; }
36  };
37 
38  struct dummy_vec {
39  void resize(size_t) {}
40  dummy_ptr operator[](unsigned int) { return dummy_ptr(); }
41  };
42 
43  struct dummy_mutex {
44  void lock() {}
45  void unlock() {}
46  };
47 
48  template <typename T>
50  typedef std::unique_ptr<T> type;
51  };
52  template <>
53  struct choose_unique_ptr<void> {
54  typedef dummy_ptr type;
55  };
56 
57  template <>
58  struct choose_unique_ptr<void const> {
59  typedef dummy_ptr type;
60  };
61 
62  template <typename T>
64  typedef std::vector<std::shared_ptr<T>> type;
65  };
66  template <>
67  struct choose_shared_vec<void> {
68  typedef dummy_vec type;
69  };
70  template <>
71  struct choose_shared_vec<void const> {
72  typedef dummy_vec type;
73  };
74  template <typename T>
75  struct choose_mutex {
76  using type = std::mutex;
77  };
78  template <>
79  struct choose_mutex<void> {
80  using type = dummy_mutex;
81  };
82  } // namespace impl
83  } // namespace stream
84 } // namespace edm
85 
86 #endif
dummy_ptr operator[](unsigned int)
Definition: dummy_helpers.h:40
static std::mutex mutex
Definition: Proxy.cc:8
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::vector< std::shared_ptr< T > > type
Definition: dummy_helpers.h:64