EventAnalysis  1.0.0
DataStoreUser.h
Go to the documentation of this file.
1 /*
2  * DataStoreUser.h
3  *
4  * Created on: 24 Dec 2019
5  * Author: Nicola Mori
6  */
7 
8 #ifndef DATASTOREUSER_H_
9 #define DATASTOREUSER_H_
10 
11 #include "core/ObserverPtr.h"
12 #include "data/DataStoreManager.h"
13 
14 namespace EA {
15 
18 
19 public:
20  DataStoreUser() : _repr{std::make_shared<Representation>()} {}
21 
23  virtual ~DataStoreUser() {}
24 
31  if (dsManager) {
32  _repr->dsManager = dsManager;
33  return true;
34  } else
35  return false;
36  }
37 
43 
44 protected:
46  friend class DataStoreUser;
48  };
49 
50  DataStoreUser(const std::shared_ptr<Representation> &impl) : _repr{impl} {}
51 
52  std::shared_ptr<Representation> &GetRepresentation() { return _repr; }
53 
54 private:
55  std::shared_ptr<Representation> _repr;
56 };
57 
58 } // namespace EA
59 #endif /* DATASTOREUSER_H_ */
virtual ~DataStoreUser()
Destructor.
Definition: DataStoreUser.h:23
A smart pointer not owning the wrapped object.
Definition: ObserverPtr.h:28
DataStoreUser()
Definition: DataStoreUser.h:20
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
observer_ptr< DataStoreManager > dsManager
Definition: DataStoreUser.h:47
DataStoreUser(const std::shared_ptr< Representation > &impl)
Definition: DataStoreUser.h:50
std::shared_ptr< Representation > & GetRepresentation()
Definition: DataStoreUser.h:52
observer_ptr< DataStoreManager > GetDataStoreManager()
Getter for the Data store manager.
Definition: DataStoreUser.h:42
Interface for classes needing access to the data stores.
Definition: DataStoreUser.h:17
virtual bool SetDataStoreManager(observer_ptr< DataStoreManager > dsManager)
Injector for dependency on DataStoreManager.
Definition: DataStoreUser.h:30
Definition: DataStoreUser.h:45
std::shared_ptr< Representation > _repr
Definition: DataStoreUser.h:55