OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
RelayService Class Reference

#include "relayService.h"

Inheritance diagram for RelayService:
Service

Public Member Functions

 RelayService (const std::string &_ip, const std::string &_name, ot::serviceID_t _id, const std::string &_type, Session *_session, const std::string &_websocketIp, Service *_connectedService)
 Constructor.
 
virtual ~RelayService ()
 Deconstructor.
 
ServiceconnectedService () const
 Will return the connected service.
 
void setWebsocketIP (const std::string &_ip)
 Will set the websocket ip of the relay service.
 
std::string websocketIP (void) const
 Will return the IP address of the websocket.
 
virtual std::string toJSON (void) const override
 Will return a JSON string representing this service.
 
virtual std::list< unsigned long long > portNumbers (void) const override
 Will return the port numbers of this service.
 
- Public Member Functions inherited from Service
 Service (ServiceManager *_owner, const ServiceInformation &_info)
 
virtual ~Service ()
 
void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const
 Add the object contents to the provided JSON object.
 
ot::app::RunResult run (const SessionInformation &_sessionInformation, const std::string &_url, ot::port_t _port, ot::port_t _websocketPort=0)
 
bool shutdown (void)
 
bool checkAlive (void)
 
void incrStartCounter (void)
 
const ServiceInformationinformation (void) const
 
unsigned int startCounter (void) const
 
const std::string & url (void) const
 
ot::port_t port (void) const
 
const std::string & websocketUrl (void) const
 
ot::port_t websocketPort (void) const
 
 Service (const std::string &_url, const std::string &_name, ot::serviceID_t _id, const std::string &_type, Session *_session, bool _showDebugInfo)
 Constructor.
 
virtual ~Service ()
 Deconstructor.
 
void setURL (const std::string &_url)
 Will set the ip of this service.
 
void setName (const std::string &_name)
 Will set the name of this service.
 
void setID (ot::serviceID_t _id)
 Will set the ID for this service.
 
void setReceiveBroadcastMessages (bool _receive)
 Will set the receive broadcast messages flag.
 
void setVisible (void)
 Will set the visible state of the service.
 
void setHidden (void)
 Will set the visible state of the service to false and notify all other services in the same session.
 
std::string url (void) const
 Will return the ip of this service.
 
std::string name (void) const
 Will return the name of this service.
 
ot::serviceID_t id (void) const
 Will return the ID of this service.
 
std::string type (void) const
 Will return the type of this service.
 
SessiongetSession (void) const
 Will return the session this service belongs to.
 
bool receiveBroadcastMessages (void) const
 Will return true if this service wants to receive broadcast messages.
 
bool isVisible (void) const
 Will return true if this service is visible.
 
void writeDataToValue (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const
 

Additional Inherited Members

- Protected Attributes inherited from Service
std::string m_name
 This services IP address.
 
ot::serviceID_t m_id
 This services name.
 
std::string m_type
 This services ID.
 
Sessionm_session
 This services type.
 
bool m_receiveBroadcastMessages
 The session this service belongs to.
 
bool m_isVisible
 

Constructor & Destructor Documentation

◆ RelayService()

RelayService::RelayService ( const std::string & _ip,
const std::string & _name,
ot::serviceID_t _id,
const std::string & _type,
Session * _session,
const std::string & _websocketIp,
Service * _connectedService )

Constructor.

Parameters
_ipThe IP address of this service
_nameThe name of this service
_idThe ID of this service
_sessionThe session this service belongs to
_websocketIPThe ip of the websocket
_connectedServiceThe service that is connected to the websocket

◆ ~RelayService()

RelayService::~RelayService ( )
virtual

Deconstructor.

Member Function Documentation

◆ connectedService()

Service * RelayService::connectedService ( ) const
inline

Will return the connected service.

◆ portNumbers()

std::list< unsigned long long > RelayService::portNumbers ( void ) const
overridevirtual

Will return the port numbers of this service.

Reimplemented from Service.

◆ setWebsocketIP()

void RelayService::setWebsocketIP ( const std::string & _ip)
inline

Will set the websocket ip of the relay service.

◆ toJSON()

std::string RelayService::toJSON ( void ) const
overridevirtual

Will return a JSON string representing this service.

Reimplemented from Service.

◆ websocketIP()

std::string RelayService::websocketIP ( void ) const
inline

Will return the IP address of the websocket.


The documentation for this class was generated from the following files: