BMA Server Framework
Public Member Functions | Public Attributes | List of all members
core::Service Class Reference

#include <Service.h>

Inheritance diagram for core::Service:
Inheritance graph
[legend]
Collaboration diagram for core::Service:
Collaboration graph
[legend]

Public Member Functions

 Service ()
 
void removeFromSessionList (Session *session)
 
virtual void sessionErrorHandler (std::string errorString, Session *session)
 
virtual SessiongetSocketAccept (EPoll &epoll)
 
void output (Session *session) override
 Output the consoles array to the console.
 
- Public Member Functions inherited from core::Command
virtual bool check (std::string request)
 
virtual int processCommand (std::string request, Session *session, std::stringstream &data)
 
void setName (std::string name)
 
std::string getName ()
 

Public Attributes

std::vector< Session * > sessions
 
CommandList commands
 
- Public Attributes inherited from core::Object
std::string name
 
std::string tag
 

Detailed Description

Service

The Service object is instantiated as a single object upon construction of the parent TCPServerSocket and is provided as a parameter whenever a new Session object is created. It provides server level services to Command handlers as well as determining the behavior of the socket.

Constructor & Destructor Documentation

◆ Service()

core::Service::Service ( )

Use this constructor to create a new Service object.

Parameters
serverA reference to the parent server creating the object.

Member Function Documentation

◆ getSocketAccept()

Session * core::Service::getSocketAccept ( EPoll epoll)
virtual

getSocketAccept is designed to allow a polymorphic extension of this object to return a type of object that extends the definition of the server socket. Returning the appropriate session object that extends from Session provides the mechanism where the server can select the protocol dialog for the desired service.

Reimplemented in core::ConsoleService.

Member Data Documentation

◆ commands

CommandList core::Service::commands

The commands object is a CommandList and is used to store Command objects to be parsed and run as data comes into the session.

◆ sessions

std::vector<Session *> core::Service::sessions

The list of sessions that are currently open and being maintained by this object.


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