OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
relayService.h
Go to the documentation of this file.
1/*
2 * relayService.h
3 *
4 * Created on: January 08, 2020
5 * Author: Alexander Kuester
6 * Copyright (c) 2020 openTwin
7 */
8
9#pragma once
10
11#include "OTCore/CoreTypes.h"
12
13// Session service header
14#include <Service.h>
15
16// C++ header
17#include <string>
18
19class RelayService : public Service {
20public:
21
30 const std::string & _ip,
31 const std::string & _name,
33 const std::string & _type,
34 Session * _session,
35 const std::string & _websocketIp,
36 Service * _connectedService
37 );
38
40 virtual ~RelayService();
41
43 Service * connectedService() const { return m_connectedService; }
44
46 void setWebsocketIP(const std::string & _ip) { m_websocketIP = _ip; }
47
49 std::string websocketIP(void) const { return m_websocketIP; }
50
51 virtual std::string toJSON(void) const override;
52
54 virtual std::list<unsigned long long> portNumbers(void) const override;
55
56private:
57
58 Service * m_connectedService;
59 std::string m_websocketIP;
60
61 RelayService() = delete;
62 RelayService(const RelayService &) = delete;
63
64};
Definition relayService.h:19
Service * connectedService() const
Will return the connected service.
Definition relayService.h:43
void setWebsocketIP(const std::string &_ip)
Will set the websocket ip of the relay service.
Definition relayService.h:46
std::string websocketIP(void) const
Will return the IP address of the websocket.
Definition relayService.h:49
virtual std::string toJSON(void) const override
Will return a JSON string representing this service.
Definition relayService.cpp:32
virtual ~RelayService()
Deconstructor.
Definition relayService.cpp:30
virtual std::list< unsigned long long > portNumbers(void) const override
Will return the port numbers of this service.
Definition relayService.cpp:42
Definition Service.h:17
Definition Session.h:11
unsigned short serviceID_t
ID type used to identify a service (16 bit unsigned integer).
Definition CoreTypes.h:14