nx_server_plugin_sdk 1.0 Server Plugin SDK

i_async_operation_handler.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <nx/sdk/interface.h>
6
7 #include "i_data_list.h"
8 #include "i_device_agent.h"
9 #include "i_engine.h"
10
11 namespace nx::sdk::cloud_storage {
12
16 class IMediaChunk
17 {
18 public:
19 virtual int64_t startTimeMs() const = 0;
20 virtual int64_t durationMs() const = 0;
21 // Pointer to location url should be valid at least while MediaChunkList object
22 // which contains this MediaChunk is alive.
23 virtual const char* locationUrl() const = 0;
24
25 virtual ~IMediaChunk() = default;
26 };
27
28 class IMediaChunkList:
29 public Interface<IMediaChunkList>,
30 public IDataList
31 {
32 public:
33 virtual const IMediaChunk* get() const = 0;
34 };
35
39 class IIndexArchive: public Interface<IIndexArchive>
40 {
41 public:
42 virtual const IMediaChunkList* addedChunks() const = 0;
43 virtual const IMediaChunkList* removedChunks() const = 0;
44 virtual int streamIndex() const = 0;
45 };
46
50 class IDeviceArchive: public Interface<IDeviceArchive>
51 {
52 public:
53 virtual const IList<IIndexArchive>* indexArchive() = 0;
54 virtual IDeviceAgent* deviceAgent() const = 0;
55 };
56
62 class IAsyncOperationHandler: public Interface<IAsyncOperationHandler>
63 {
64 public:
65 static auto interfaceId() { return makeId("nx::sdk::archive::IAsyncOperationHandler"); }
66
74 virtual void onArchiveUpdated(
75 const char* engineId,
76 const char* lastSequenceId,
77 nx::sdk::ErrorCode errorCode,
78 const IList<IDeviceArchive>* deviceArchive) const = 0;
79
80 virtual void onSaveOperationCompleted(
81 const char* engineId,
82 MetadataType metadataType,
83 nx::sdk::ErrorCode errorCode) const = 0;
84 };
85
86 } // namespace nx::sdk::cloud_storage
nx::sdk::cloud_storage::IMediaChunkList
Definition: i_async_operation_handler.h:28
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::cloud_storage::IDeviceArchive
Definition: i_async_operation_handler.h:50
nx::sdk::cloud_storage::IMediaChunk
Definition: i_async_operation_handler.h:16
nx::sdk::cloud_storage::IDataList
Definition: i_data_list.h:9
nx::sdk::cloud_storage::IAsyncOperationHandler
Definition: i_async_operation_handler.h:62
nx::sdk::cloud_storage::IIndexArchive
Definition: i_async_operation_handler.h:39
nx::sdk::cloud_storage::IAsyncOperationHandler::onArchiveUpdated
virtual void onArchiveUpdated(const char *engineId, const char *lastSequenceId, nx::sdk::ErrorCode errorCode, const IList< IDeviceArchive > *deviceArchive) const =0
nx::sdk::cloud_storage::IDeviceAgent
Definition: i_device_agent.h:21
nx::sdk::cloud_storage
Definition: algorithm.cpp:9
nx::sdk::IList
Definition: i_list.h:10
nx::sdk::IRefCountable::makeId
static const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:77