StoreRef.h
Go to the documentation of this file.
1 
20 #pragma once
21 
22 #include <memory>
23 
24 namespace ConfigDB
25 {
26 class Store;
27 
28 class StoreRef : public std::shared_ptr<Store>
29 {
30 public:
31  StoreRef() = default;
32 
33  StoreRef(std::shared_ptr<Store> store) : shared_ptr(store)
34  {
35  }
36 
38 
39  explicit operator bool() const;
40 
41 private:
42  using shared_ptr::reset;
43 };
44 
45 class StoreUpdateRef : public StoreRef
46 {
47 public:
48  StoreUpdateRef() = default;
49 
50  StoreUpdateRef(const StoreRef& store)
51  {
52  *this = store;
53  }
54 
55  StoreUpdateRef(const StoreUpdateRef& store) : StoreUpdateRef(static_cast<const StoreRef&>(store))
56  {
57  }
58 
60 
62 
64  {
65  return operator=(static_cast<const StoreRef&>(other));
66  }
67 };
68 
69 } // namespace ConfigDB
Definition: StoreRef.h:29
StoreRef(std::shared_ptr< Store > store)
Definition: StoreRef.h:33
Definition: StoreRef.h:46
StoreUpdateRef & operator=(const StoreRef &other)
StoreUpdateRef(const StoreRef &store)
Definition: StoreRef.h:50
StoreUpdateRef(const StoreUpdateRef &store)
Definition: StoreRef.h:55
StoreUpdateRef & operator=(const StoreUpdateRef &other)
Definition: StoreRef.h:63
Definition: Array.h:26