nx_metadata_sdk 1.0 Metadata SDK

i_utility_provider.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/i_string.h>
7
8 namespace nx {
9 namespace sdk {
10
21 class IUtilityProvider0: public Interface<IUtilityProvider0>
22 {
23 public:
24 static auto interfaceId() { return makeId("nx::sdk::IUtilityProvider"); }
25
30 virtual int64_t vmsSystemTimeSinceEpochMs() const = 0;
31
33 protected: virtual const IString* getHomeDir() const = 0;
45 public: std::string homeDir() const { return toPtr(getHomeDir())->str(); }
46 };
47
48 class IUtilityProvider1: public Interface<IUtilityProvider1, IUtilityProvider0>
49 {
50 public:
51 static auto interfaceId() { return makeId("nx::sdk::IUtilityProvider1"); }
52
54 protected: virtual const IString* getServerSdkVersion() const = 0;
58 public: std::string serverSdkVersion() const { return toPtr(getServerSdkVersion())->str(); }
59 };
60
61 class IUtilityProvider: public Interface<IUtilityProvider, IUtilityProvider1>
62 {
63 public:
64 static auto interfaceId() { return makeId("nx::sdk::IUtilityProvider2"); }
65
66 virtual const char* serverId() const = 0;
67 };
68 using IUtilityProvider2 = IUtilityProvider;
69
70 } // namespace sdk
71 } // namespace nx
nx::sdk::Interface
Definition: interface.h:49
nx::sdk::IUtilityProvider0::getHomeDir
virtual const IString * getHomeDir() const =0
nx::sdk::IUtilityProvider1::serverSdkVersion
std::string serverSdkVersion() const
Definition: i_utility_provider.h:58
nx::sdk::IUtilityProvider1
Definition: i_utility_provider.h:48
nx::sdk::IUtilityProvider0::homeDir
std::string homeDir() const
Definition: i_utility_provider.h:45
nx::sdk::IUtilityProvider0::vmsSystemTimeSinceEpochMs
virtual int64_t vmsSystemTimeSinceEpochMs() const =0
nx::sdk::IString
Definition: i_string.h:10
nx::sdk::IUtilityProvider
Definition: i_utility_provider.h:61
nx
Definition: apple_utils.h:6
nx::sdk::IUtilityProvider0
Definition: i_utility_provider.h:21
nx::sdk::IRefCountable::makeId
static constexpr const InterfaceId * makeId(const char(&charArray)[len])
Definition: i_ref_countable.h:77
nx::sdk::IUtilityProvider1::getServerSdkVersion
virtual const IString * getServerSdkVersion() const =0