EventAnalysis  1.0.0
EventDataCacheManager.h
Go to the documentation of this file.
1 /*
2  * EventDataCacheManager.h
3  *
4  * Created on: 15 Dec 2017
5  * Author: Nicola Mori
6  */
7 
10 #ifndef EVENTDATACACHEMANAGER_H_
11 #define EVENTDATACACHEMANAGER_H_
12 
13 // EventAnalysis headers
14 #include "core/ObserverPtr.h"
15 
16 // C/C++ headers
17 #include <list>
18 #include <memory>
19 
20 namespace EA {
21 
22 class EventDataCache;
23 
30 
31 public:
37  bool AddCache(std::unique_ptr<EventDataCache> cache);
38 
45  observer_ptr<EventDataCache> GetCache(const std::string &storeName);
46 
52  bool SetCurrentEvent(unsigned int event);
53 
58  bool CacheValues();
59 
64  bool Unbook();
65 
70  bool Clean();
71 
72 private:
73  using Caches = std::list<std::unique_ptr<EventDataCache>>;
75 };
76 } // namespace EA
77 
78 #endif /* EVENTDATACACHEMANAGER_H_ */
A smart pointer not owning the wrapped object.
Definition: ObserverPtr.h:28
bool SetCurrentEvent(unsigned int event)
Sets the current event for all the caches.
Definition: EventDataCacheManager.cpp:29
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
bool Clean()
Cleans all the caches.
Definition: EventDataCacheManager.cpp:56
Manager class for event data cache objects.
Definition: EventDataCacheManager.h:29
Caches _caches
Definition: EventDataCacheManager.h:74
observer_ptr< EventDataCache > GetCache(const std::string &storeName)
Retrieves the cache attached at the given event data store.
Definition: EventDataCacheManager.cpp:20
std::list< std::unique_ptr< EventDataCache > > Caches
Definition: EventDataCacheManager.h:73
bool Unbook()
Unbooks all the booked objects for all the caches.
Definition: EventDataCacheManager.cpp:47
bool AddCache(std::unique_ptr< EventDataCache > cache)
Adds a cache to the manager.
Definition: EventDataCacheManager.cpp:15
bool CacheValues()
Caches all the booked objects for all the caches.
Definition: EventDataCacheManager.cpp:38