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::IPlugin>
21 {
22 public:
23 static auto interfaceId() { return makeId("nx::sdk::analytics::IPlugin"); }
24
29 protected: virtual void getManifest(Result<const IString*>* outResult) const = 0;
30 public: Result<const IString*> manifest() const
31 {
32 Result<const IString*> result;
33 getManifest(&result);
34 return result;
35 }
36
41 protected: virtual void doCreateEngine(Result<IEngine*>* outResult) = 0;
42 public: Result<IEngine*> createEngine()
43 {
44 Result<IEngine*> result;
45 doCreateEngine(&result);
46 return result;
47 }
48 };
49
50 } // namespace analytics
51 } // namespace sdk
52 } // namespace nx
nx::sdk::Interface
Definition: interface.h:28
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::Result
Definition: result.h:47
nx
Definition: apple_utils.h:6
nx::sdk::IRefCountable::makeId
static constexpr const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:78