GlobalObjects
Lade ...
Suche ...
Keine Treffer
TcpMessage.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_TCPMESSAGE_H
2#define INC_TCPMESSAGE_H
3//-----------------------------------------------------------------------------
44//-----------------------------------------------------------------------------
45#include "TcpTypes.h"
46#include <cstring>
47#include "TcpSocketTypes.h"
48//-----------------------------------------------------------------------------
49//-----------------------------------------------------------------------------
50#ifdef _MSC_VER
51 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
52 #pragma warning( disable : 4251 )
53#endif
54//-----------------------------------------------------------------------------
55namespace tcp
56{
57 //---------------------------------------------------------------------------
58 // >>>>>>>>>>>>>>>>>>>>>>>>> AbstractMessage >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
59 //---------------------------------------------------------------------------
76 {
77 protected:
78 //============== Konstruktor
79 //-----------------------------------------------------------------------
90 //-----------------------------------------------------------------------
91
92 public:
93 //============== Destruktore
94 //-----------------------------------------------------------------------
105 //-----------------------------------------------------------------------
106 };
107 //---------------------------------------------------------------------------
108 // <<<<<<<<<<<<<<<<<<<<<<<<< AbstractMessage <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
109 //---------------------------------------------------------------------------
110
111 //---------------------------------------------------------------------------
112 // >>>>>>>>>>>>>>>>>>>>>>>>>>> Message >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
113 //---------------------------------------------------------------------------
147 {
148 private:
149 //============== Attribute
150 //-----------------------------------------------------------------------
160 unsigned int m_uiMessageID;
161 //-----------------------------------------------------------------------
182 //-----------------------------------------------------------------------
192 std::string m_strInfo;
193 //-----------------------------------------------------------------------
203 std::size_t m_nRawMessageSize;
204 //-----------------------------------------------------------------------
215 //-----------------------------------------------------------------------
226 //-----------------------------------------------------------------------
237 //-----------------------------------------------------------------------
238
239 protected:
240 //============== Konstruktoren
241 //-----------------------------------------------------------------------
252 //-----------------------------------------------------------------------
253
254 public:
255 //============== Konstruktoren
256 //-----------------------------------------------------------------------
301 Message( char * pszTransmitData, std::size_t nTransmitDataSize );
302 //-----------------------------------------------------------------------
332 Message( char * pszRawMsg,
333 std::size_t nRawMsgSize,
334 unsigned int uiMessageID,
335 int iActionCode,
336 const std::string & rstrInfo );
337 //-----------------------------------------------------------------------
347 virtual ~Message();
348 //-----------------------------------------------------------------------
349
350 private:
351 //============== Copy-Konstruktor
352 //-----------------------------------------------------------------------
362 Message( const Message & );
363 //-----------------------------------------------------------------------
364
365 //+ ============ Methoden
366 //-----------------------------------------------------------------------
382 //-----------------------------------------------------------------------
398 //-----------------------------------------------------------------------
399
400 public:
401 //============== Methoden
402 //-----------------------------------------------------------------------
412 char * getRawMsgPt();
413 //-----------------------------------------------------------------------
423 std::size_t getRawMsgSize() const;
424 //-----------------------------------------------------------------------
435 //-----------------------------------------------------------------------
445 std::size_t getTransmitDataSize() const;
446 //-----------------------------------------------------------------------
456 unsigned int getMsgID() const;
457 //-----------------------------------------------------------------------
469 int getActionCode() const;
470 //-----------------------------------------------------------------------
480 std::string getInfo() const;
481 //-----------------------------------------------------------------------
503 std::size_t getRawMsg( char *& prszRawMsg, bool bCopy = true );
504 //-----------------------------------------------------------------------
525 std::size_t getTransmitData( char *& prszSendMsg, bool bCopy = true );
526 //-----------------------------------------------------------------------
527
528 private:
529 //============== Operatoren
530 //-----------------------------------------------------------------------
540 Message & operator= ( const Message & );
541 //-----------------------------------------------------------------------
542 };
543 //---------------------------------------------------------------------------
544 // <<<<<<<<<<<<<<<<<<<<<<<<<<< Message <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
545 //---------------------------------------------------------------------------
546
547 //---------------------------------------------------------------------------
548 // >>>>>>>>>>>>>>>>>>>>>>>>> ServerAcceptMessage >>>>>>>>>>>>>>>>>>>>>>>>>>>>
549 //---------------------------------------------------------------------------
566 {
567 private:
568 //============== Attribute
569 //-----------------------------------------------------------------------
580 //-----------------------------------------------------------------------
581
582 protected:
583 //============== Konstruktoren
584 //-----------------------------------------------------------------------
595 //-----------------------------------------------------------------------
596
597 public:
598 //============== Konstruktoren
599 //-----------------------------------------------------------------------
611 ServerAcceptMessage( SOCKET NewSocket );
612 //-----------------------------------------------------------------------
623 //-----------------------------------------------------------------------
624
625 private:
626 //============== Copy-Konstruktor
627 //-----------------------------------------------------------------------
638 //-----------------------------------------------------------------------
639
640 public:
641 //============== Methoden
642 //-----------------------------------------------------------------------
652 SOCKET getSocket();
653 //-----------------------------------------------------------------------
664 //-----------------------------------------------------------------------
665
666 private:
667 //============== Operatoren
668 //-----------------------------------------------------------------------
679 //-----------------------------------------------------------------------
680 };
681 //---------------------------------------------------------------------------
682 // <<<<<<<<<<<<<<<<<<<<<<<<< ServerAcceptMessage <<<<<<<<<<<<<<<<<<<<<<<<<<<<
683 //---------------------------------------------------------------------------
684
685 //---------------------------------------------------------------------------
686 // >>>>>>>>>>>>>>>>>>>>>>>>>>> ServerMessage >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
687 //---------------------------------------------------------------------------
704 {
705 protected:
706 //============== Konstruktoren
707 //-----------------------------------------------------------------------
718 //-----------------------------------------------------------------------
728 ServerMessage( char *, std::size_t );
729 //-----------------------------------------------------------------------
730
731 public:
732 //============== Konstruktoren
733 //-----------------------------------------------------------------------
778 ServerMessage( SOCKET ClientSocket,
779 char * pszTransmitData,
780 std::size_t nTransmitDataSize );
781 //-----------------------------------------------------------------------
810 ServerMessage( SOCKET ClientSocket,
811 char * pszRawMsg,
812 std::size_t nRawMsgSize,
813 unsigned int uiMessageID,
814 int iActionCode,
815 const std::string & rstrInfo);
816 //-----------------------------------------------------------------------
826 virtual ~ServerMessage();
827 //-----------------------------------------------------------------------
828 private:
829 //============== Copy-Konstruktor
830 //-----------------------------------------------------------------------
841
842 //============== Operatoren
843 //-----------------------------------------------------------------------
853 ServerMessage & operator= ( const ServerMessage & );
854 //-----------------------------------------------------------------------
855 };
856 //---------------------------------------------------------------------------
857 // <<<<<<<<<<<<<<<<<<<<<<<<<< ServerMessage <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
858 //---------------------------------------------------------------------------
859 #ifdef _MSC_VER
860 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
861 #pragma warning( default : 4251 )
862 #endif
863 //---------------------------------------------------------------------------
864} // namespace tcp
865//-----------------------------------------------------------------------------
866#endif
Bindet die Socket-Bibliothek/en ein und definiert Socket-Typen.
Für jede Bibliothek, hier 'TcpLib' gibt es eine Typen-Datei.
#define __tcp_export_dll
Definition TcpTypes.h:59
virtual ~AbstractMessage()
std::size_t getRawMsg(char *&prszRawMsg, bool bCopy=true)
int m_iActionCode
Definition TcpMessage.h:181
int getActionCode() const
std::size_t getRawMsgSize() const
Message(char *pszTransmitData, std::size_t nTransmitDataSize)
virtual ~Message()
int initSendMsgFromData()
std::size_t m_nTransmitDataSize
Definition TcpMessage.h:225
unsigned int m_uiMessageID
Definition TcpMessage.h:160
char * getRawMsgPt()
Message(const Message &)
char * m_pszRawMessage
Definition TcpMessage.h:214
Message(char *pszRawMsg, std::size_t nRawMsgSize, unsigned int uiMessageID, int iActionCode, const std::string &rstrInfo)
unsigned int getMsgID() const
char * getTransmitDataPt()
int initDataFromSendMsg()
std::string getInfo() const
std::size_t getTransmitData(char *&prszSendMsg, bool bCopy=true)
char * m_pszTransmitData
Definition TcpMessage.h:236
std::string m_strInfo
Definition TcpMessage.h:192
std::size_t m_nRawMessageSize
Definition TcpMessage.h:203
std::size_t getTransmitDataSize() const
ServerAcceptMessage(const ServerAcceptMessage &)
ServerAcceptMessage(SOCKET NewSocket)
SOCKET m_ClientSocket
Definition TcpMessage.h:579
virtual ~ServerMessage()
ServerMessage(const ServerMessage &)
ServerMessage(SOCKET ClientSocket, char *pszRawMsg, std::size_t nRawMsgSize, unsigned int uiMessageID, int iActionCode, const std::string &rstrInfo)
ServerMessage(char *, std::size_t)
ServerMessage(SOCKET ClientSocket, char *pszTransmitData, std::size_t nTransmitDataSize)
Definition TcpClient.h:55