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
11
#include "
ServiceStartupInformation.h
"
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
24
class
LocalDirectoryService
:
public
ot::ServiceBase
{
25
public
:
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
43
private
:
44
std::list<std::string> m_supportedServices;
45
LoadInformation
m_loadInformation;
46
std::list<std::pair<SessionInformation, ServiceInformation>> m_services;
47
48
LocalDirectoryService
() =
delete
;
49
LocalDirectoryService
(
LocalDirectoryService
&) =
delete
;
50
LocalDirectoryService
& operator = (
LocalDirectoryService
&) =
delete
;
51
};
ServiceInformation.h
SessionInformation.h
JSON.h
ServiceBase.h
LoadInformation.h
ServiceStartupInformation.h
LocalDirectoryService
#define LocalDirectoryService
Definition
Application.cpp:27
_serviceURL
const char * _serviceURL
Definition
dllmain.cpp:93
LoadInformation
Definition
LoadInformation.h:5
LoadInformation::load_t
double load_t
Definition
LoadInformation.h:8
LocalDirectoryService
Definition
LocalDirectoryService.h:24
LocalDirectoryService::loadInformation
const LoadInformation & loadInformation(void) const
Definition
LocalDirectoryService.h:29
LocalDirectoryService::setSupportedServices
void setSupportedServices(const std::list< std::string > &_serviesNames)
Definition
LocalDirectoryService.h:34
ServiceInformation
Definition
ServiceInformation.h:6
ServiceStartupInformation
Definition
ServiceStartupInformation.h:10
SessionInformation
Definition
SessionInformation.h:6
ot::JsonDocument
JSON document.
Definition
JSON.h:276
ot::ServiceBase
General service information. The ServiceBase class is used to store the general service information.
Definition
ServiceBase.h:24
Services
GlobalDirectoryService
include
LocalDirectoryService.h
Generated by
1.10.0