GlobalObjects
Lade ...
Suche ...
Keine Treffer
GloCommunicator.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLOCOMMUNICATOR_H
2#define INC_GLOCOMMUNICATOR_H
3//-----------------------------------------------------------------------------
36//-----------------------------------------------------------------------------
37#include <string>
38#include <queue>
39#include "GloTypes.h"
40#include "GloCallBackSpy.h"
41#if defined (__PTHREADS)
42 #include <EuEndlessPThread.h>
43 #include <semaphore.h>
44#else
45 #include "EuRepeatingThread.h"
46#endif
47//-----------------------------------------------------------------------------
48namespace glo
49{
50 //---------------------------------------------------------------------------
51 /* Forwards */
52 class OrderMsg;
53 //---------------------------------------------------------------------------
54 #ifdef _MSC_VER
55 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
56 #pragma warning( disable : 4251 )
57 #endif
58 //---------------------------------------------------------------------------
81 #if defined (__PTHREADS)
82 class __glo_export_dll Communicator : public EuEndlessPThread
83 #else
85 #endif
86 {
87 private:
88 //============== Attribute
89 //-----------------------------------------------------------------------
99 unsigned int m_uiID;
100 //-----------------------------------------------------------------------
110 std::string m_sClientName;
111 //-----------------------------------------------------------------------
123 std::queue<OrderMsg *> m_MsgQueue;
124 //-----------------------------------------------------------------------
125
126 protected:
127 //============== Attribute
128 //-----------------------------------------------------------------------
142 unsigned int m_uiOrderCounter;
143 //-----------------------------------------------------------------------
144
145 public:
146 //============== Konstruktoren
147 //-----------------------------------------------------------------------
158 //-----------------------------------------------------------------------
168 virtual ~Communicator();
169 //-----------------------------------------------------------------------
170
171 private:
172 //============== Konstruktoren
173 //-----------------------------------------------------------------------
184 //-----------------------------------------------------------------------
185
186 public:
187 //============== Methoden
188 //-----------------------------------------------------------------------
202 virtual void setCommunicatorID( unsigned int uiID );
203 //-----------------------------------------------------------------------
215 unsigned int getCommunicatorID() const;
216 //-----------------------------------------------------------------------
228 virtual void setClientName( const std::string & rstrClientName );
229 //-----------------------------------------------------------------------
241 std::string getClientName() const;
242 //-----------------------------------------------------------------------
254 const std::string & getClientNameAsRef();
255 //-----------------------------------------------------------------------
270 virtual int takeOverResult( OrderMsg * pOrderMsg );
271 //-----------------------------------------------------------------------
285 virtual int assignDBManager( OrderMsg * pOrderMsg );
286 //-----------------------------------------------------------------------
287
288 protected:
289 //============== Methoden
290 //-----------------------------------------------------------------------
306 virtual int sendToDBManager( OrderMsg * pOrderMsg ) const = 0;
307 //-----------------------------------------------------------------------
326 virtual void processServerMsg( OrderMsg * pOrderMsg ) const;
327 //-----------------------------------------------------------------------
342 virtual void work() override;
343 //-----------------------------------------------------------------------
344
345 public:
346 //============== Operatoren
347 //-----------------------------------------------------------------------
360 bool operator== ( const Communicator & rT ) const;
361 bool operator!= ( const Communicator & rT ) const;
363 //-----------------------------------------------------------------------
364
365 private:
366 //============== Operatoren
367 //-----------------------------------------------------------------------
377 Communicator & operator= ( const Communicator & );
378 //-----------------------------------------------------------------------
379 };
380 //---------------------------------------------------------------------------
381 #ifdef _MSC_VER
382 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
383 #pragma warning( default : 4251 )
384 #endif
385 //---------------------------------------------------------------------------
386} // namespace glo
387#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:63
Basisklasse für einen Thread der seine Arbeit endlos bis zum Abbruch ausführt.
Definition EuEndlessPThread.h:69
Basisklasse für einen Thread der seine Arbeit endlos bis zum Abbruch ausführt.
Definition EuRepeatingThread.h:78
OberKlasse von LocalThread, ClientThread und ServerThread, weil diese als Sender und Empfänger (Kommu...
Definition GloCommunicator.h:86
const std::string & getClientNameAsRef()
std::queue< OrderMsg * > m_MsgQueue
Definition GloCommunicator.h:123
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:142
virtual void setClientName(const std::string &rstrClientName)
std::string m_sClientName
Definition GloCommunicator.h:110
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:99
Mittels dieser Klasse wird die Kommunikation zwischen der Applikation, welche GlobalObjects nutzt und...
Definition GloOrderMsg.h:77
Definition GloAbstractBaseLot.h:42