NetworkManager Class Reference

Handles all the network scheme for MedCenter The Network scheme declares that each instance of the application has a server and connects to all other machine Moreover, if a machine is not reachable, the connection will be retried each CHECK_CONNECTION_DELAY ms. More...

#include <Network/NetworkManager.h>

List of all members.

Public Types

enum  MessageType { MT_PatientInfo, MT_ChatMessage, MT_Connection, MT_Disconnection }

Public Member Functions

 NetworkManager (Logger *pLogger, QObject *parent=0)
void write (MessageType type, const QByteArray &data)
void write (NClient *pClient, MessageType type, const QByteArray &data)
Q_SLOT void appendData (QByteArray data)
 Adds data to the data received list.
QList< QByteArray > & dataReceived ()
 returns the data received from the network
void clearData ()
 Clears the data received.
const QList< MachineData > & getMachinesList () const
Q_SIGNAL void newClientConnected (NClient *pClient)
 Signal sent when the manager is connected to a new client.
Q_SLOT void addMachine (QString machineIP, QString machineName)
Q_SLOT void deleteMachine (QString machineIP)
Q_SIGNAL void machineListUpdated ()

Detailed Description

Handles all the network scheme for MedCenter The Network scheme declares that each instance of the application has a server and connects to all other machine Moreover, if a machine is not reachable, the connection will be retried each CHECK_CONNECTION_DELAY ms.

When a new client is connected, the signal newClientConnected is sent No signal informs if data are available to read, but the function dataReceived() returns these data (the list is empty if no data are available)


Constructor & Destructor Documentation

NetworkManager::NetworkManager ( Logger *  pLogger,
QObject *  parent = 0 
)
Parameters:
pLogger 
parent 

Member Function Documentation

void NetworkManager::appendData ( QByteArray  data  ) 

Adds data to the data received list.

Parameters:
data 
QList< QByteArray > & NetworkManager::dataReceived (  ) 

returns the data received from the network

Returns:
void NetworkManager::newClientConnected ( NClient pClient  ) 

Signal sent when the manager is connected to a new client.

Parameters:
pClient pointer to the new client

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Properties
Generated on Tue Sep 13 01:46:01 2011 for MedCenter by  doxygen 1.6.3