GlobalObjects
Lade ...
Suche ...
Keine Treffer
GloCommunicator.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLOCOMMUNICATOR_H
2#define INC_GLOCOMMUNICATOR_H
3//-----------------------------------------------------------------------------
43//-----------------------------------------------------------------------------
44#include <string>
45#include <queue>
46#include "GloTypes.h"
47#include "GloCallBackSpy.h"
48#if defined (__PTHREADS)
49 #include <EuEndlessPThread.h>
50 #include <semaphore.h>
51#else
52 #include "EuRepeatingThread.h"
53#endif
54//-----------------------------------------------------------------------------
55namespace glo
56{
57 //---------------------------------------------------------------------------
58 /* Forwards */
59 class OrderMsg;
60 //---------------------------------------------------------------------------
61 #ifdef _MSC_VER
62 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
63 #pragma warning( disable : 4251 )
64 #endif
65 //---------------------------------------------------------------------------
88 #if defined (__PTHREADS)
89 class __glo_export_dll Communicator : public EuEndlessPThread
90 #else
92 #endif
93 {
94 private:
95 //============== Attribute
96 //-----------------------------------------------------------------------
106 unsigned int m_uiID;
107 //-----------------------------------------------------------------------
117 std::string m_sClientName;
118 //-----------------------------------------------------------------------
130 std::queue<OrderMsg *> m_MsgQueue;
131 //-----------------------------------------------------------------------
132
133 protected:
134 //============== Attribute
135 //-----------------------------------------------------------------------
149 unsigned int m_uiOrderCounter;
150 //-----------------------------------------------------------------------
151
152 public:
153 //============== Konstruktoren
154 //-----------------------------------------------------------------------
165 //-----------------------------------------------------------------------
175 virtual ~Communicator();
176 //-----------------------------------------------------------------------
177
178 private:
179 //============== Konstruktoren
180 //-----------------------------------------------------------------------
191 //-----------------------------------------------------------------------
192
193 public:
194 //============== Methoden
195 //-----------------------------------------------------------------------
209 virtual void setCommunicatorID( unsigned int uiID );
210 //-----------------------------------------------------------------------
222 unsigned int getCommunicatorID() const;
223 //-----------------------------------------------------------------------
235 virtual void setClientName( const std::string & rstrClientName );
236 //-----------------------------------------------------------------------
248 std::string getClientName() const;
249 //-----------------------------------------------------------------------
261 const std::string & getClientNameAsRef();
262 //-----------------------------------------------------------------------
277 virtual int takeOverResult( OrderMsg * pOrderMsg );
278 //-----------------------------------------------------------------------
292 virtual int assignDBManager( OrderMsg * pOrderMsg );
293 //-----------------------------------------------------------------------
294
295 protected:
296 //============== Methoden
297 //-----------------------------------------------------------------------
313 virtual int sendToDBManager( OrderMsg * pOrderMsg ) const = 0;
314 //-----------------------------------------------------------------------
333 virtual void processServerMsg( OrderMsg * pOrderMsg ) const;
334 //-----------------------------------------------------------------------
349 virtual void work() override;
350 //-----------------------------------------------------------------------
351
352 public:
353 //============== Operatoren
354 //-----------------------------------------------------------------------
367 bool operator== ( const Communicator & rT ) const;
368 bool operator!= ( const Communicator & rT ) const;
370 //-----------------------------------------------------------------------
371
372 private:
373 //============== Operatoren
374 //-----------------------------------------------------------------------
384 Communicator & operator= ( const Communicator & );
385 //-----------------------------------------------------------------------
386 };
387 //---------------------------------------------------------------------------
388 #ifdef _MSC_VER
389 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
390 #pragma warning( default : 4251 )
391 #endif
392 //---------------------------------------------------------------------------
393} // namespace glo
394#endif
Header für EuEndlessPThread
Header für RepeatingThread
Header für CallBackSpy
Für jede Bibliothek, hier 'GlobalObjects' gibt es eine Typen-Datei.
#define __glo_export_dll
Definition GloTypes.h:70
Basisklasse für einen Thread der seine Arbeit endlos bis zum Abbruch ausführt.
Definition EuEndlessPThread.h:84
Basisklasse für einen Thread der seine Arbeit endlos bis zum Abbruch ausführt.
Definition EuRepeatingThread.h:93
OberKlasse von LocalThread, ClientThread und ServerThread, weil diese als Sender und Empfänger (Kommu...
Definition GloCommunicator.h:93
const std::string & getClientNameAsRef()
std::queue< OrderMsg * > m_MsgQueue
Definition GloCommunicator.h:130
virtual int assignDBManager(OrderMsg *pOrderMsg)
virtual void work() override
virtual int takeOverResult(OrderMsg *pOrderMsg)
std::string getClientName() const
unsigned int m_uiOrderCounter
Definition GloCommunicator.h:149
virtual void setClientName(const std::string &rstrClientName)
std::string m_sClientName
Definition GloCommunicator.h:117
virtual ~Communicator()
virtual void processServerMsg(OrderMsg *pOrderMsg) const
virtual void setCommunicatorID(unsigned int uiID)
virtual int sendToDBManager(OrderMsg *pOrderMsg) const =0
unsigned int getCommunicatorID() const
Communicator(const Communicator &)
unsigned int m_uiID
Definition GloCommunicator.h:106
Mittels dieser Klasse wird die Kommunikation zwischen der Applikation, welche GlobalObjects nutzt und...
Definition GloOrderMsg.h:84
Definition GloAbstractBaseLot.h:49