ImagingTools Core SDK
IStorage.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// ACF includes
6#include <iser/ISerializable.h>
7
8// ImtCore includes
9#include <imtbase/CTimeRange.h>
10
11
12namespace imtlog
13{
14
15
16class IStorage: virtual public istd::IPolymorphic
17{
18public:
19 struct ObjectInfo
20 {
21 int64_t ObjectId;
22 QByteArray TypeId;
23 imtbase::CTimeRange timeRange;
24 };
25
26 typedef QVector<ObjectInfo> ObjectInfos;
27
28 /*
29 Get objects info for given sectionId/timeRange.
30 */
31 virtual ObjectInfos GetObjectInfos(
32 const QByteArray& sectionId,
33 const imtbase::CTimeRange& timeRange) const = 0;
34 /*
35 Add/Serialize object with given sectionId/typeId/timeRange into storage.
36 Return: objectId in storage
37 */
38 virtual int64_t AddObject(
39 const QByteArray& sectionId,
40 const QByteArray& typeId,
41 const imtbase::CTimeRange& timeRange,
42 const iser::ISerializable* objectPtr) = 0;
43 /*
44 Update/Serialize object with given sectionId/objectId into storage.
45 */
46 virtual bool UpdateObject(
47 const QByteArray& sectionId,
48 int64_t objectId,
49 const iser::ISerializable* objectPtr) = 0;
50 /*
51 Removeobject with given sectionId/objectId from storage.
52 */
53 virtual bool RemoveObjects(
54 const QByteArray& sectionId,
55 int64_t objectId) = 0;
56};
57
58
59} // namespace imtlog
60
61