Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ocoppacket.h

Go to the documentation of this file.
00001 /* GPL!*/
00002 
00003 #ifndef OPIE_OCOP_PACKET_H
00004 #define OPIE_OCOP_PACKET_H
00005 
00006 #include <qcstring.h>
00007 #include <qstring.h>
00008 
00013 struct OCOPHead {
00014     int magic;
00015     int type;
00016     int chlen;
00017     int funclen;
00018     int datalen;
00019 };
00020 
00026 class OCOPPacket {
00027 public:
00028     enum Type {
00029         Register = 0, Unregister, Call,
00030         Method,  Reply, RegisterChannel,
00031         UnregisterChannel, Return, Signal,
00032         IsRegistered
00033     };
00041     OCOPPacket( int type, const QCString& channel = QCString(),
00042                 const QCString& header = QCString(),
00043                 const QByteArray& array = QByteArray() );
00044 
00045     QByteArray toByteArray()const;
00046     int type()const;
00047     QCString channel()const;
00048     QCString header()const;
00049     QByteArray content()const;
00050     OCOPHead head()const;
00051 
00052     void setType( int type );
00053     void setChannel( const QCString& );
00054     void setHeader(const QCString& );
00055     void setContent( const QByteArray& );
00056 
00057 private:
00058     int m_type;
00059     QCString m_channel;
00060     QCString m_header;
00061     QByteArray m_content;
00062 };
00063 
00064 #endif

Generated on Sat Nov 5 16:18:35 2005 for OPIE by  doxygen 1.4.2