init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
81
Telegram/SourceFiles/storage/storage_facade.h
Normal file
81
Telegram/SourceFiles/storage/storage_facade.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <rpl/producer.h>
|
||||
#include "base/enum_mask.h"
|
||||
|
||||
namespace Data {
|
||||
struct MessagesResult;
|
||||
} // namespace Data
|
||||
|
||||
namespace Storage {
|
||||
|
||||
struct SparseIdsListResult;
|
||||
|
||||
struct SharedMediaAddNew;
|
||||
struct SharedMediaAddExisting;
|
||||
struct SharedMediaAddSlice;
|
||||
struct SharedMediaRemoveOne;
|
||||
struct SharedMediaRemoveAll;
|
||||
struct SharedMediaInvalidateBottom;
|
||||
struct SharedMediaUnloadThread;
|
||||
struct SharedMediaQuery;
|
||||
struct SharedMediaKey;
|
||||
using SharedMediaResult = SparseIdsListResult;
|
||||
struct SharedMediaSliceUpdate;
|
||||
|
||||
struct UserPhotosSetBack;
|
||||
struct UserPhotosAddNew;
|
||||
struct UserPhotosAddSlice;
|
||||
struct UserPhotosRemoveOne;
|
||||
struct UserPhotosRemoveAfter;
|
||||
struct UserPhotosReplace;
|
||||
struct UserPhotosQuery;
|
||||
struct UserPhotosResult;
|
||||
struct UserPhotosSliceUpdate;
|
||||
|
||||
class Facade {
|
||||
public:
|
||||
Facade();
|
||||
|
||||
void add(SharedMediaAddNew &&query);
|
||||
void add(SharedMediaAddExisting &&query);
|
||||
void add(SharedMediaAddSlice &&query);
|
||||
void remove(SharedMediaRemoveOne &&query);
|
||||
void remove(SharedMediaRemoveAll &&query);
|
||||
void invalidate(SharedMediaInvalidateBottom &&query);
|
||||
void unload(SharedMediaUnloadThread &&query);
|
||||
|
||||
rpl::producer<SharedMediaResult> query(SharedMediaQuery &&query) const;
|
||||
SharedMediaResult snapshot(const SharedMediaQuery &query) const;
|
||||
bool empty(const SharedMediaKey &key) const;
|
||||
rpl::producer<SharedMediaSliceUpdate> sharedMediaSliceUpdated() const;
|
||||
rpl::producer<SharedMediaRemoveOne> sharedMediaOneRemoved() const;
|
||||
rpl::producer<SharedMediaRemoveAll> sharedMediaAllRemoved() const;
|
||||
rpl::producer<SharedMediaInvalidateBottom> sharedMediaBottomInvalidated() const;
|
||||
|
||||
void add(UserPhotosSetBack &&query);
|
||||
void add(UserPhotosAddNew &&query);
|
||||
void add(UserPhotosAddSlice &&query);
|
||||
void remove(UserPhotosRemoveOne &&query);
|
||||
void remove(UserPhotosRemoveAfter &&query);
|
||||
void replace(UserPhotosReplace &&query);
|
||||
|
||||
rpl::producer<UserPhotosResult> query(UserPhotosQuery &&query) const;
|
||||
rpl::producer<UserPhotosSliceUpdate> userPhotosSliceUpdated() const;
|
||||
|
||||
~Facade();
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
const std::unique_ptr<Impl> _impl;
|
||||
|
||||
};
|
||||
|
||||
} // namespace Storage
|
||||
Reference in New Issue
Block a user