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

Serves as interface between Base or PrivateBase and Manager. In the documentation the ClientThread is also referred to as the client communicator, if NOT the server communicator (ServerThread) is meant. More...

#include <GloLocalThread.h>

Inheritance diagram for glo::LocalThread:

Public Member Functions

 LocalThread (const std::string &rstrSchemaPath, const std::vector< std::string > &rAllowedSchemes)
 
 ~LocalThread ()
 
virtual int assignDBManager (OrderMsg *pOrderMsg) override
 
virtual void cancel () override
 
bool operator== (const LocalThread &rT) const
 
bool operator!= (const LocalThread &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

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

 LocalThread ()
 
 LocalThread (const LocalThread &)
 
LocalThreadoperator= (const LocalThread &)
 

Private Attributes

Managerm_pDBManager
 

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

Serves as interface between Base or PrivateBase and Manager. In the documentation the ClientThread is also referred to as the client communicator, if NOT the server communicator (ServerThread) is meant.

The LocalThread sends requests to the Manager and waits until the request is executed (or not).

The Manager hands over the processed request as a response to the local request and response queue. Objects of this class are necessary if the Base is called with "LOCAL" and the Manager is not available as a server but directly.

To allow parallel access to the database, this class is designed as a thread (derived via Communicator from EuEndlessPThread).

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ LocalThread() [1/3]

glo::LocalThread::LocalThread ( )
private

The standard constructor is not available.

◆ LocalThread() [2/3]

glo::LocalThread::LocalThread ( const std::string & rstrSchemaPath,
const std::vector< std::string > & rAllowedSchemes )

Constructor with parameter passing.

Parameters
[in]rstrSchemaPathThe complete path name (e.g. "C:/Path/") in which the schema files are located.
[in]rAllowedSchemesThe permitted schemas (their names).
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~LocalThread()

glo::LocalThread::~LocalThread ( )

Destructor.

◆ LocalThread() [3/3]

glo::LocalThread::LocalThread ( const LocalThread & )
private

The copy constructor is not available.

Member Function Documentation

◆ assignDBManager()

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

Passes an order 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.

◆ cancel()

virtual void glo::LocalThread::cancel ( )
overridevirtual

Clears the memory before the thread is terminated. Is called in the owning PrivateBase before the thread is terminated.

Since it is virtual, this method cannot be called in the destructor.

Note
This method only exists when not compiled with POSIX threads (defined (__PTHREADS)).

Reimplemented from eut::RepeatingThread.

◆ operator!=()

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

Comparison operator.

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

◆ operator=()

LocalThread & glo::LocalThread::operator= ( const LocalThread & )
private

The assignment operator is not available.

◆ operator==()

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

Comparison operator.

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

◆ sendToDBManager()

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

Passes an order (received via LocalThread::assignDBManager() ) directly to the Manager.

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

Implements glo::Communicator.

Member Data Documentation

◆ m_pDBManager

Manager* glo::LocalThread::m_pDBManager
private

The pointer to the Manager.


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