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/interface.h>
6 #include <nx/sdk/result.h>
7
8 #include <nx/sdk/i_string.h>
9 #include <nx/sdk/i_plugin.h>
10
11 #include "i_engine.h"
12
13 namespace nx {
14 namespace sdk {
15 namespace analytics {
16
20 class IPlugin: public Interface<IPlugin, nx::sdk::IPlugin0>
21 {
22 public:
23 static auto interfaceId() { return makeId("nx::sdk::analytics::IPlugin"); }
24
26 protected: virtual void getManifest(Result<const IString*>* outResult) const = 0;
34 public: Result<const IString*> manifest() const
35 {
36 Result<const IString*> result;
37 getManifest(&result);
38 return result;
39 }
40
42 protected: virtual void doCreateEngine(Result<IEngine*>* outResult) = 0;
47 public: Result<IEngine*> createEngine()
48 {
49 Result<IEngine*> result;
50 doCreateEngine(&result);
51 return result;
52 }
53 };
54 using IPlugin0 = IPlugin;
55
56 } // namespace analytics
57 } // namespace sdk
58 } // namespace nx
nx::sdk::Interface
Definition: interface.h:49
nx::sdk::analytics::IPlugin
Definition: i_plugin.h:20
nx::sdk::analytics::IPlugin::doCreateEngine
virtual void doCreateEngine(Result< IEngine *> *outResult)=0
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:34
nx::sdk::IPlugin
Definition: i_plugin.h:27
nx::sdk::Result
Definition: result.h:47
nx
Definition: apple_utils.h:6
nx::sdk::analytics::IPlugin::createEngine
Result< IEngine * > createEngine()
Definition: i_plugin.h:47
nx::sdk::IRefCountable::makeId
static constexpr const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:77