GlobalObjects
Loading...
Searching...
No Matches
glo::ServerThread Class Reference

An object of this class serves as interface between Manager and Base or PrivateBase. More...

#include <GloServerThread.h>

Inheritance diagram for glo::ServerThread:

Public Member Functions

 ServerThread (Server::TcpServerReceiverTransmitter *pTcpServerReceiverTransmitter)
 
 ~ServerThread ()
 
virtual int assignDBManager (OrderMsg *pOrderMsg) override
 
ManagerDBManager ()
 
Server::TcpServerReceiverTransmittergetTcpServerReceiverTransmitter ()
 
virtual int takeOverResult (OrderMsg *pOrderMsg) override
 
bool operator== (const ServerThread &rT) const
 
bool operator!= (const ServerThread &rT) const
 
- Public Member Functions inherited from glo::Communicator
 Communicator ()
 
virtual ~Communicator ()
 
std::string getClientName () const
 
const std::string & getClientNameAsRef ()
 
unsigned int getCommunicatorID () const
 
virtual void setClientName (const std::string &rstrClientName)
 
virtual void setCommunicatorID (unsigned int uiID)
 
bool operator== (const Communicator &rT) const
 
bool operator!= (const Communicator &rT) const
 
- Public Member Functions inherited from eut::RepeatingThread
 RepeatingThread ()
 
virtual ~RepeatingThread ()
 
virtual void cancel ()
 
virtual void finishBreak ()
 
int getBreakCounter ()
 
bool isInExclusiveAccess () const
 
void setExclusiveAccess ()
 
void signalInput ()
 
virtual int start ()
 
RepeatingThread::STATUS status () const
 
virtual void takeABreak ()
 
bool testCancel ()
 
void unsetExclusiveAccess ()
 
void waitForInput ()
 

Protected Member Functions

virtual void processServerMsg (OrderMsg *pOrderMsg) const override
 
virtual int sendToDBManager (OrderMsg *pOrderMsg) const override
 
- Protected Member Functions inherited from glo::Communicator
virtual void work () override
 
- Protected Member Functions inherited from eut::RepeatingThread
ORDER getOrder ()
 
STATUS getStatus ()
 
void setStatus (STATUS eStatus)
 
void threadWork ()
 
void toOrder (ORDER eOrder)
 

Private Member Functions

 ServerThread ()
 
 ServerThread (const ServerThread &)
 
ServerThreadoperator= (ServerThread &)
 

Private Attributes

Managerm_pDBManager
 
Server::TcpServerReceiverTransmitterm_pTcpServerReceiverTransmitter
 

Additional Inherited Members

- Public Types inherited from eut::RepeatingThread
enum  EuTHREADERROR { EuTHREAD_ERR_NO_THREAD = -10301 , EuTHREAD_ERR_THREAD_ALREADY_WORKING = -10302 , EuTHREAD_ERR_THREAD_BREAK_COUNT_LESS_THAN_ZERO = -10303 , EuTHREAD_ERR_UNKNOWN = -10400 }
 Error range = -10301 to -10400 More...
 
enum  ORDER { eUNDEFINED , eDO_WORK , eEXIT }
 
enum  STATUS {
  eAT_THE_START , eWORKING , ePAUSING , eENDING ,
  eCOMPLETED
}
 
- Public Attributes inherited from eut::RepeatingThread
std::string m_strDebugInfo
 
- Protected Attributes inherited from glo::Communicator
unsigned int m_uiOrderCounter
 

Detailed Description

An object of this class serves as interface between Manager and Base or PrivateBase.

Sends information of the Manager to connected clients.

The remote peer is the ClientThread via the TCP communicators.

See also
ClientThread
Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ServerThread() [1/3]

glo::ServerThread::ServerThread ( )
private

The standard constructor is not available.

◆ ServerThread() [2/3]

glo::ServerThread::ServerThread ( Server::TcpServerReceiverTransmitter * pTcpServerReceiverTransmitter)

Constructor with parameter passing.

Parameters
[in]pTcpServerReceiverTransmitterIs required because the TCP communication is handled by this server reader writer.
Attention
Responsibility for the Server::TcpServerReceiverTransmitter remains with the calling instance. Objects of this class do not remove pTcpServerReceiverTransmitter from memory.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~ServerThread()

glo::ServerThread::~ServerThread ( )

Destructor.

◆ ServerThread() [3/3]

glo::ServerThread::ServerThread ( const ServerThread & )
private

The copy constructor is not available.

Member Function Documentation

◆ assignDBManager()

virtual int glo::ServerThread::assignDBManager ( OrderMsg * pOrderMsg)
overridevirtual

Sends a job to the Manager and waits for response.

Parameters
[in]pOrderMsgThe order for the Manager.
Returns
A return value < 0 indicates an error.

Reimplemented from glo::Communicator.

◆ DBManager()

Manager * glo::ServerThread::DBManager ( )

Returns pointers to its Manager.

Attention
The calling instance must not remove the supplied object from memory.

◆ getTcpServerReceiverTransmitter()

Server::TcpServerReceiverTransmitter * glo::ServerThread::getTcpServerReceiverTransmitter ( )

Returns pointers to its TcpServerReceiverTransmitter, which receives or sends the packets.

Attention
The calling instance must not remove the supplied object from memory.

◆ operator!=()

bool glo::ServerThread::operator!= ( const ServerThread & rT) const

Comparison operator.

Parameters
[in]rTThe object to be compared with this one.

◆ operator=()

ServerThread & glo::ServerThread::operator= ( ServerThread & )
private

The assignment operator is not available.

◆ operator==()

bool glo::ServerThread::operator== ( const ServerThread & rT) const

Comparison operator.

Parameters
[in]rTThe object to be compared with this one.

◆ processServerMsg()

virtual void glo::ServerThread::processServerMsg ( OrderMsg * pOrderMsg) const
overrideprotectedvirtual

Processes an order, e.g. from the Manager or a request to transmit information from monitored objects by sending the order or information to the client via TcpServerReceiverTransmitter

Parameters
[in]pOrderMsgThe order to be sent.
Note
The same method of the superclass is not called.

Reimplemented from glo::Communicator.

◆ sendToDBManager()

virtual int glo::ServerThread::sendToDBManager ( OrderMsg * pOrderMsg) const
overrideprotectedvirtual

Passes an order directly to the Manager.

Parameters
[in]pOrderMsgThe order for the Manager.
Returns
A return value < 0 indicates an error.

Implements glo::Communicator.

◆ takeOverResult()

virtual int glo::ServerThread::takeOverResult ( OrderMsg * pOrderMsg)
overridevirtual

Adopts a message into its message queue for processing.

Parameters
[in]pOrderMsgThe message to be processed.
Returns
A return value < 0 indicates an error.

Reimplemented from glo::Communicator.

Member Data Documentation

◆ m_pDBManager

Manager* glo::ServerThread::m_pDBManager
private

The pointer to the Manager.

◆ m_pTcpServerReceiverTransmitter

Server::TcpServerReceiverTransmitter* glo::ServerThread::m_pTcpServerReceiverTransmitter
private

The TcpServerReceiverTransmitter, which receives and sends the packets.


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