nx_server_plugin_sdk 1.0 Server Plugin SDK

i_integration.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/i_integration.h>
6 #include <nx/sdk/i_string.h>
7 #include <nx/sdk/interface.h>
8 #include <nx/sdk/result.h>
9
10 #include "i_async_operation_handler.h"
11 #include "i_engine.h"
12
13 namespace nx::sdk::cloud_storage {
14
18 class IIntegration: public Interface<IIntegration, nx::sdk::IIntegration>
19 {
20 public:
21 static auto interfaceId()
22 {
23 return makeIdWithAlternative("nx::sdk::archive::IIntegration",
24 /* Old name from 6.0. */ "nx::sdk::archive::IPlugin");
25 }
26
27 protected: virtual void getManifest(Result<const IString*>* outResult) const = 0;
32 public: Result<const IString*> manifest() const
33 {
34 Result<const IString*> result;
35 getManifest(&result);
36 return result;
37 }
38
39 protected: virtual void doObtainEngine(const char* url,
40 const IAsyncOperationHandler* asyncOperationHandler,
41 Result<IEngine*>* outResult) = 0;
42
49 public: Result<IEngine*> obtainEngine(
50 const char* url, const IAsyncOperationHandler* asyncOperationHandler)
51 {
52 Result<IEngine*> result;
53 doObtainEngine(url, asyncOperationHandler, &result);
54 return result;
55 }
56 };
57
58 } // namespace nx::sdk::cloud_storage
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::cloud_storage::IAsyncOperationHandler
Definition: i_async_operation_handler.h:69
nx::sdk::cloud_storage::IIntegration::obtainEngine
Result< IEngine * > obtainEngine(const char *url, const IAsyncOperationHandler *asyncOperationHandler)
Definition: i_integration.h:49
nx::sdk::cloud_storage::IIntegration
Definition: i_integration.h:18
nx::sdk::Result
Definition: result.h:52
nx::sdk::cloud_storage
Definition: algorithm.cpp:9
nx::sdk::IRefCountable::makeIdWithAlternative
static std::vector< const InterfaceId * > makeIdWithAlternative(const char(&charArray)[len], const char(&alternativeCharArray)[alternativeLen])
Definition: i_ref_countable.h:87
nx::sdk::cloud_storage::IIntegration::manifest
Result< const IString * > manifest() const
Definition: i_integration.h:32