GroupStateStore.h 482 B

1234567891011121314151617181920212223242526
  1. #include <GroupState.h>
  2. #include <GroupStateCache.h>
  3. #include <GroupStatePersistence.h>
  4. #ifndef _GROUP_STATE_STORE_H
  5. #define _GROUP_STATE_STORE_H
  6. class GroupStateStore {
  7. public:
  8. GroupStateStore(const size_t maxSize);
  9. GroupState& get(const GroupId& id);
  10. GroupState& set(const GroupId& id, const GroupState& state);
  11. void flush();
  12. private:
  13. GroupStateCache cache;
  14. GroupStatePersistence persistence;
  15. LinkedList<GroupId> evictedIds;
  16. void trackEviction();
  17. };
  18. #endif