/
farado
/
farado-binara
Обзор
Документация
Войти
/
farado
/
farado-binara
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
develop
src/datenaro/session/changes_manager.h
43 строки
994 B
Ostapenko Alexey
[detenaro] Корректировка работы с изменениями.
18 мар 2024, 08:41
18 мар 2024, 08:41
8c7e9e4
Код
Авторство
О чём код?
#ifndef CHANGES_MANAGER_H #define CHANGES_MANAGER_H #include <mutex> #include <set> #include <unordered_map> #include <vector> #include "common/api/changes.h" #include "common/api/result.hpp" #include "common/elements/element_type.hpp" #include "common/more/uuid.h" class ChangesManager final { public: void push(Elements::ElementType type, unsigned id); void push(Elements::ElementType type, std::vector<unsigned> ids); Api::Changes pop(const Uuids::Uuid& sessionUuid); void erase( const Uuids::Uuid& sessionUuid, Elements::ElementType type, unsigned id ); void erase( const Uuids::Uuid& sessionUuid, Elements::ElementType type, const std::vector<unsigned>& ids ); void addSession(const Uuids::Uuid& sessionUuid); void removeSession(const Uuids::Uuid& sessionUuid); private: std::mutex m_locker; std::unordered_map<Uuids::Uuid, Api::Changes> m_sessionChanges; }; #endif // CHANGES_MANAGER_H