nx_metadata_sdk 1.0 Metadata SDK

i_plugin.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_plugin.h>
6 #include <nx/sdk/i_string.h>
7 #include <nx/sdk/interface.h>
8 #include <nx/sdk/result.h>
9
10 #include "i_engine.h"
11
12 namespace nx::sdk::analytics {
13
17 class IPlugin: public Interface<IPlugin, nx::sdk::IPlugin0>
18 {
19 public:
20 static auto interfaceId()
21 {
22 return makeIdWithAlternative("nx::sdk::analytics::IPlugin",
23 /* Planned future renaming. */ "nx::sdk::analytics::IIntegration");
24 }
25
27 protected: virtual void getManifest(Result<const IString*>* outResult) const = 0;
35 public: Result<const IString*> manifest() const
36 {
37 Result<const IString*> result;
38 getManifest(&result);
39 return result;
40 }
41
43 protected: virtual void doCreateEngine(Result<IEngine*>* outResult) = 0;
48 public: Result<IEngine*> createEngine()
49 {
50 Result<IEngine*> result;
51 doCreateEngine(&result);
52 return result;
53 }
54 };
55 using IPlugin0 = IPlugin;
56
57 } // namespace nx::sdk::analytics
nx::sdk::Interface
Definition: interface.h:48
nx::sdk::analytics::IPlugin
Definition: i_plugin.h:17
nx::sdk::analytics::IPlugin::doCreateEngine
virtual void doCreateEngine(Result< IEngine *> *outResult)=0
nx::sdk::analytics
Definition: consuming_device_agent.cpp:24
nx::sdk::analytics::IPlugin::getManifest
virtual void getManifest(Result< const IString *> *outResult) const =0
nx::sdk::analytics::IPlugin::manifest
Result< const IString * > manifest() const
Definition: i_plugin.h:35
nx::sdk::IPlugin
Definition: i_plugin.h:26
nx::sdk::Result
Definition: result.h:48
nx::sdk::analytics::IPlugin::createEngine
Result< IEngine * > createEngine()
Definition: i_plugin.h:48
nx::sdk::IRefCountable::makeIdWithAlternative
static std::vector< const InterfaceId * > makeIdWithAlternative(const char(&charArray)[len], const char(&alternativeCharArray)[alternativeLen])
Definition: i_ref_countable.h:87