GlobalObjects
|
Objects of this class serve as interface between Base or PrivateBase and Manager. In the documentation the LocalThread is also called client communicator, if NOT the server communicator (ServerThread) is meant. More...
#include <GloClientThread.h>
Public Member Functions | |
ClientThread (const std::string &rstrHostname, unsigned int uiPort, int iSecTimeOut) | |
~ClientThread () | |
virtual int | assignDBManager (OrderMsg *pOrderMsg) override |
virtual void | cancel () override |
const std::map< unsigned long, ClassInfo * > * | getSchemaMap () |
bool | Orderstop () const |
void | setOrderstop (bool bOrderstop=true) |
void | setSchemaMap (std::map< unsigned long, ClassInfo * > *pSchemaMap) |
Client * | tcpClient () |
bool | operator== (const ClientThread &rT) const |
bool | operator!= (const ClientThread &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) |
virtual int | takeOverResult (OrderMsg *pOrderMsg) |
bool | operator== (const Communicator &rT) const |
bool | operator!= (const Communicator &rT) const |
Public Member Functions inherited from eut::RepeatingThread | |
RepeatingThread () | |
virtual | ~RepeatingThread () |
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 | |
void | deleteSchemaMap () |
virtual int | sendToDBManager (OrderMsg *pOrderMsg) const override |
Protected Member Functions inherited from glo::Communicator | |
virtual void | processServerMsg (OrderMsg *pOrderMsg) const |
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 | |
ClientThread () | |
ClientThread (const ClientThread &) | |
int | initTcpClient (const std::string &rstrHostname, unsigned int uiPort, int iSecTimeOut) |
ClientThread & | operator= (const ClientThread &) |
Private Attributes | |
bool | m_bOrderstop |
std::map< unsigned long, ClassInfo *, std::less< unsigned long > > * | m_pSchemaMap |
Client * | m_pTcpClient |
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 |
Objects of this class serve as interface between Base or PrivateBase and Manager. In the documentation the LocalThread is also called client communicator, if NOT the server communicator (ServerThread) is meant.
Remote station is the ServerThread via the TCP communicators.
The ClientThread sends requests via its Client to the Manager and wait s until the request is executed (or not).
The Manager (as server) passes the processed request via its corresponding ServerThread to the ClientThread, which puts the request into its request list.
Objects of this class are necessary if the Base is called with a server name or IP address and the Manager runs as server.
To allow parallel access to the database, this class is designed as a thread (derived via Communicator from EuEndlessPThread).
|
private |
The standard constructor is not available.
glo::ClientThread::ClientThread | ( | const std::string & | rstrHostname, |
unsigned int | uiPort, | ||
int | iSecTimeOut ) |
Constructor with parameter passing.
[in] | rstrHostname | The host or, server name or the IP address (e.g. "192.165.0.1"). |
[in] | uiPort | The port on which the server can be addressed. |
[in] | iSecTimeOut | The max. waiting time of the server. |
eut::ErrorNException | An exception is thrown if an error occurs. |
glo::ClientThread::~ClientThread | ( | ) |
Destructor.
|
private |
The copy constructor is not available.
|
overridevirtual |
Sends an order to the Manager and waits for response.
[in] | pOrderMsg | The order for the Manager. |
Reimplemented from glo::Communicator.
|
overridevirtual |
Clears memory and terminates an existing connection to a server before the thread is terminated. Is called in the owning PrivateBase before the thread is terminated.
Since virtual, this method cannot be called in the destructor.
Reimplemented from eut::RepeatingThread.
|
protected |
Removes the list of class information objects from memory.
const std::map< unsigned long, ClassInfo * > * glo::ClientThread::getSchemaMap | ( | ) |
Returns a pointer to the own class information objects.
|
private |
Initializes the TCP client, which communicates with a TCP server.
[in] | rstrHostname | The host or, server name or the IP address (e.g. "192.165.0.1"). |
[in] | uiPort | The port on which the server can be addressed. |
[in] | iSecTimeOut | The max. waiting time of the server. |
bool glo::ClientThread::operator!= | ( | const ClientThread & | rT | ) | const |
Comparison operator.
[in] | rT | The object to be compared with this one. |
|
private |
The assignment operator is not available.
bool glo::ClientThread::operator== | ( | const ClientThread & | rT | ) | const |
Comparison operator.
[in] | rT | The object to be compared with this one. |
bool glo::ClientThread::Orderstop | ( | ) | const |
Returns whether there is an order acceptance stop.
|
overrideprotectedvirtual |
Sends a job (received from the ClientThread::assignDBManager() ) via its TCP client to the Manager.
[in] | pOrderMsg | The order for the Manager. |
Implements glo::Communicator.
void glo::ClientThread::setOrderstop | ( | bool | bOrderstop = true | ) |
Sets the order acceptance stop.
[in] | bOrderstop | If true, no more orders are accepted. |
void glo::ClientThread::setSchemaMap | ( | std::map< unsigned long, ClassInfo * > * | pSchemaMap | ) |
Accepts the class information objects after the current ones have been removed from memory.
[in] | pSchemaMap | The new class information objects. |
Client * glo::ClientThread::tcpClient | ( | ) |
Return m_pTcpClient.
|
private |
If true, no more orders are accepted.
|
private |
The class information of the underlying schema.
|
private |
The TCP client that communicates with a TCP server.