Pool Video Switch v2
Software video switch for distributed remote display in a lecture environment
Public Member Functions | Private Member Functions | Private Attributes | List of all members
NetworkMessage Class Reference

#include "networkmessage.h"

+ Collaboration diagram for NetworkMessage:

Public Member Functions

 NetworkMessage ()
 
virtual ~NetworkMessage ()
 
int readMessage (QAbstractSocket *socket)
 
int readMessage (char *data, quint32 len)
 
bool writeMessage (QAbstractSocket *socket)
 
bool writeMessage (QUdpSocket *socket, const QHostAddress &address, quint16 port)
 
void reset ()
 
bool readComplete () const
 
bool writeComplete () const
 
bool hasField (QByteArray &key)
 
QString getFieldString (const QByteArray &key) const
 
QByteArray getFieldBytes (const QByteArray &key) const
 
void setField (const QByteArray &key, const QByteArray &value)
 
void setField (const QByteArray &key, const QString &value)
 
void buildErrorMessage (const QString &error)
 

Private Member Functions

void allocBuffer ()
 
bool parseHeader (char *header)
 
bool parseMessage (char *buffer)
 
void serializeMessage ()
 

Private Attributes

char * _buffer
 
quint32 _bufferSize
 
quint32 _bufferPos
 
quint32 _lastBufferSize
 
QHash< QByteArray, QByteArray > _fields
 
int _mode
 

Detailed Description

Definition at line 51 of file networkmessage.h.

Constructor & Destructor Documentation

NetworkMessage::NetworkMessage ( )

Definition at line 58 of file networkmessage.cpp.

NetworkMessage::~NetworkMessage ( )
virtual

Definition at line 64 of file networkmessage.cpp.

Member Function Documentation

void NetworkMessage::allocBuffer ( )
inlineprivate

Definition at line 70 of file networkmessage.cpp.

+ Here is the caller graph for this function:

void NetworkMessage::buildErrorMessage ( const QString &  error)

Definition at line 263 of file networkmessage.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

QByteArray NetworkMessage::getFieldBytes ( const QByteArray &  key) const
inline

Definition at line 76 of file networkmessage.h.

+ Here is the caller graph for this function:

QString NetworkMessage::getFieldString ( const QByteArray &  key) const
inline

Definition at line 75 of file networkmessage.h.

+ Here is the caller graph for this function:

bool NetworkMessage::hasField ( QByteArray &  key)
inline

Definition at line 74 of file networkmessage.h.

bool NetworkMessage::parseHeader ( char *  header)
private

Definition at line 146 of file networkmessage.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool NetworkMessage::parseMessage ( char *  buffer)
private

Definition at line 165 of file networkmessage.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool NetworkMessage::readComplete ( ) const
inline

Definition at line 72 of file networkmessage.h.

+ Here is the caller graph for this function:

int NetworkMessage::readMessage ( QAbstractSocket *  socket)

Definition at line 80 of file networkmessage.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int NetworkMessage::readMessage ( char *  data,
quint32  len 
)

Definition at line 123 of file networkmessage.cpp.

+ Here is the call graph for this function:

void NetworkMessage::reset ( )
inline

Definition at line 71 of file networkmessage.h.

+ Here is the caller graph for this function:

void NetworkMessage::serializeMessage ( )
private

Definition at line 236 of file networkmessage.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void NetworkMessage::setField ( const QByteArray &  key,
const QByteArray &  value 
)
inline

Definition at line 77 of file networkmessage.h.

+ Here is the caller graph for this function:

void NetworkMessage::setField ( const QByteArray &  key,
const QString &  value 
)
inline

Definition at line 78 of file networkmessage.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool NetworkMessage::writeComplete ( ) const
inline

Definition at line 73 of file networkmessage.h.

+ Here is the caller graph for this function:

bool NetworkMessage::writeMessage ( QAbstractSocket *  socket)

Definition at line 186 of file networkmessage.cpp.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool NetworkMessage::writeMessage ( QUdpSocket *  socket,
const QHostAddress &  address,
quint16  port 
)

Definition at line 213 of file networkmessage.cpp.

+ Here is the call graph for this function:

Member Data Documentation

char* NetworkMessage::_buffer
private

Definition at line 54 of file networkmessage.h.

quint32 NetworkMessage::_bufferPos
private

Definition at line 55 of file networkmessage.h.

quint32 NetworkMessage::_bufferSize
private

Definition at line 55 of file networkmessage.h.

QHash<QByteArray, QByteArray> NetworkMessage::_fields
private

Definition at line 56 of file networkmessage.h.

quint32 NetworkMessage::_lastBufferSize
private

Definition at line 55 of file networkmessage.h.

int NetworkMessage::_mode
private

Definition at line 57 of file networkmessage.h.


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