OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
LocalDirectoryService.h
Go to the documentation of this file.
1/*
2 * LocalDirectoryService.h
3 *
4 * Created on: 23.09.2022
5 * Author: Alexander Kuester
6 * Copyright (c) 2022, OpenTwin
7 */
8
9#pragma once
10
12#include "LoadInformation.h"
13#include "ServiceInformation.h"
14#include "SessionInformation.h"
15
16// OpenTwin header
17#include "OTCore/JSON.h"
18#include "OTCore/ServiceBase.h"
19
20// C++ header
21#include <string>
22#include <list>
23
25public:
26 LocalDirectoryService(const std::string& _url);
27 virtual ~LocalDirectoryService();
28
29 const LoadInformation& loadInformation(void) const { return m_loadInformation; }
30 LoadInformation::load_t load(void) const;
31
32 bool updateSystemUsageValues(ot::JsonDocument& _jsonDocument);
33
34 void setSupportedServices(const std::list<std::string>& _serviesNames) { m_supportedServices = _serviesNames; }
35 bool supportsService(const std::string& _serviceName);
36
37 bool requestToRunService(const ServiceStartupInformation& _serviceInfo);
38 bool requestToRunRelayService(const ServiceStartupInformation& _serviceInfo, std::string& _websocketURL, std::string& _relayServiceURL);
39
40 void sessionClosed(const SessionInformation& _session);
41 void serviceClosed(const SessionInformation& _session, const ServiceInformation& _service, const std::string& _serviceURL);
42
43private:
44 std::list<std::string> m_supportedServices;
45 LoadInformation m_loadInformation;
46 std::list<std::pair<SessionInformation, ServiceInformation>> m_services;
47
48 LocalDirectoryService() = delete;
50 LocalDirectoryService& operator = (LocalDirectoryService&) = delete;
51};
#define LocalDirectoryService
Definition Application.cpp:27
const char * _serviceURL
Definition dllmain.cpp:93
Definition LoadInformation.h:5
double load_t
Definition LoadInformation.h:8
Definition LocalDirectoryService.h:24
const LoadInformation & loadInformation(void) const
Definition LocalDirectoryService.h:29
void setSupportedServices(const std::list< std::string > &_serviesNames)
Definition LocalDirectoryService.h:34
Definition ServiceInformation.h:6
Definition ServiceStartupInformation.h:10
Definition SessionInformation.h:6
JSON document.
Definition JSON.h:276
General service information. The ServiceBase class is used to store the general service information.
Definition ServiceBase.h:24