Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XFcCommunicationHandler Class Reference

XFcCommunicationHandler is base for incoming and outgoing data flow. More...

Inheritance diagram for XFcCommunicationHandler:

Inheritance graph
[legend]
Collaboration diagram for XFcCommunicationHandler:

Collaboration graph
[legend]
List of all members.

Public Types

enum  XFCNET_HANDLER_ERRORS {
  XFCNET_MAX_CLIENT_COUNT_REACHED = 1000,
  XFCNET_INDEX_OUT_OF_RANGE,
  XFCNET_INVALID_CLIENT_ID,
  XFCNET_ARRAYSIZELEAK_ERROR,
  XFCNET_ARRAYSIZEMEMORY_ERROR,
  XFCNET_ARRAYSIZE_OK = 1
}
 Enumerated communication handlers internal errors. More...

enum  XFCNET_CONNECTION_SPEED {
  XFCNET_MODEM_28_8,
  XFCNET_HSCD_14_4,
  XFCNET_GPRS,
  XFCNET_WLAN_2MB,
  XFCNET_WLAN_11MB,
  XFCNET_BLUETOOTH
}
 Connection speed enumeration. More...


Public Member Functions

virtual XFCIMPORT ~XFcCommunicationHandler ()
 Virtual destructor.

XFCIMPORT INT addClientCommWin (XFcClientCommWin *aClientWinData)
 Sets client communication data.

XFCIMPORT XFcClientCommWinremoveClientCommWin (INT32 aClient)
 Removes client count window.

XFCIMPORT XFcClientCommWingetClientCommWin (INT32 aClient)
 Gets client count window.

XFCIMPORT void setUnknownSenderHandler (XFcUnknownSender *aHandler)
 Sets handler for unknown packet sender.

XFCIMPORT XFcUnknownSendergetUnknownSenderHandler ()
 Gets handle of unknown packet sender.

XFCIMPORT INT setMaxClientCount (INT32 aClientCount)
 Sets maximum client count.

XFCIMPORT INT32 getClientCount () const
 Gets client count.

XFCIMPORT INT32 getMaxClientCount () const
 Gets maximum client count.

XFCIMPORT void setClientBaseNumber (INT32 aBase)
 Sets base number of client.

XFCIMPORT INT32 getClientBaseNumber () const
 Gets base number of client.

XFCIMPORT void setClientLost (XFcClientLost *aClientLost)
 Sets client lost handler.

XFCIMPORT XFcClientLostgetClientLost () const
 Sets client lost handler.

XFCIMPORT void setConnectionType (INT aType)
 Sets connection type.

XFCIMPORT INT getConnectionType () const
 Gets connection type.

XFCIMPORT void setConnectionSpeed (INT aSpeedType)
 Sets handlers connection speed.

XFCIMPORT void tuneConnectionSpeed (INT32 aSpeed)
 Tunes connection speed directly.

XFCIMPORT INT32 getConnectionSpeed () const
 Gets current connection speed.

XFCIMPORT INT32 testAddress (const XFcAddress &aAddress)
 Tests incoming packet sender address.

XFCIMPORT void setLastError (INT32 aError)
 Sets handlers last error.

XFCIMPORT INT32 getLastError () const
 Gets handlers last error.

XFCIMPORT void setClientLastError (INT32 aClient, INT32 aError)
 Sets client last error.

XFCIMPORT INT32 getClientLastError (INT32 aClient) const
 Gets clients last error.

virtual XFCIMPORT void closeService ()=0
 Close the communication service.

virtual XFCIMPORT INT outgoing ()=0
 Sends data.

virtual XFCIMPORT INT incoming ()=0
 Gets data.

virtual XFCIMPORT void checkActivity ()=0
 Activity check.

virtual XFCIMPORT void unknownSender (const XFcAddress *, XFcObjectPacketBase *)=0
 Handles data from unknown address.


Protected Member Functions

XFCIMPORT INT baseInit ()
 Initializes packet.

XFCIMPORT XFcCommunicationHandler ()
 Protected constructor.


Protected Attributes

XFcClientCommWin ** mClientWinData
 Holds client array.

XFcUnknownSendermUSender
 Holds unknown sender, senders address is not known.

XFcClientLostmClientLost
 Holds connection lost event interface.

INT32 mConnectionSpeed
 Connection speed.


Private Attributes

INT mMaxClientCount
 Holds maximum client count.

INT mBaseNumber
 Holds base number for client.

INT32 mConnectionType
 Holds connection type, e.g. INET, IRDA, BLUETOOTH.

INT32 mLastError
 Holds communication handlers last error, argument is initialized to XFCNET_ERROR.


Detailed Description

XFcCommunicationHandler is base for incoming and outgoing data flow.

It uses array of clients which are "connected" together. Data flow will allways go throught this object. It offers basic functionality to handle communication between two clients. It doesn't own any of clients, one have to delete all added clients before deleting this class.


Member Enumeration Documentation

enum XFcCommunicationHandler::XFCNET_CONNECTION_SPEED
 

Connection speed enumeration.

Enumeration values:
XFCNET_MODEM_28_8  28.8 kbit/s.
XFCNET_HSCD_14_4  14.4 kbit/s.
XFCNET_GPRS  9 - 150 kbit/s.
XFCNET_WLAN_2MB  2 Mbit/s.
XFCNET_WLAN_11MB  11 Mbit/s.
XFCNET_BLUETOOTH  Bluetooth.

enum XFcCommunicationHandler::XFCNET_HANDLER_ERRORS
 

Enumerated communication handlers internal errors.

Enumeration values:
XFCNET_MAX_CLIENT_COUNT_REACHED  Communication handler has reached its maximum client count.

New clients can not be added.

XFCNET_INDEX_OUT_OF_RANGE  Given index is out of range. Array underflow or overflow.
XFCNET_INVALID_CLIENT_ID  No client found with given id.
XFCNET_ARRAYSIZELEAK_ERROR  There is more created clients than newly created array can handle.
XFCNET_ARRAYSIZEMEMORY_ERROR  Handler was not able to alloc new array for clients. Old array stays.
XFCNET_ARRAYSIZE_OK  No error, return value when called setMaxClientCount().


Constructor & Destructor Documentation

XFCIMPORT XFcCommunicationHandler::XFcCommunicationHandler   [protected]
 

Protected constructor.

virtual XFCIMPORT XFcCommunicationHandler::~XFcCommunicationHandler   [virtual]
 

Virtual destructor.


Member Function Documentation

XFCIMPORT INT XFcCommunicationHandler::addClientCommWin XFcClientCommWin   aClientWinData
 

Sets client communication data.

Parameters:
aClientWinData client communication data.

XFCIMPORT INT XFcCommunicationHandler::baseInit   [protected]
 

Initializes packet.

virtual XFCIMPORT void XFcCommunicationHandler::checkActivity   [pure virtual]
 

Activity check.

Implemented in XFcBtHandler, and XFcInetHandler.

virtual XFCIMPORT void XFcCommunicationHandler::closeService   [pure virtual]
 

Close the communication service.

Implemented in XFcBtHandler, and XFcInetHandler.

XFCIMPORT INT32 XFcCommunicationHandler::getClientBaseNumber   const
 

Gets base number of client.

XFCIMPORT XFcClientCommWin* XFcCommunicationHandler::getClientCommWin INT32    aClient
 

Gets client count window.

Parameters:
aClient client index.
Returns:
client communication window if successful, or NULL otherwise.
Note:
If NULL is returned error value is set.

XFCIMPORT INT32 XFcCommunicationHandler::getClientCount   const
 

Gets client count.

Returns:
client count, number of clients added to mClientWinData.

XFCIMPORT INT32 XFcCommunicationHandler::getClientLastError INT32    aClient const
 

Gets clients last error.

Parameters:
aClient client identifier.
Returns:
XFCNET_INDEX_OUT_OF_RANGE if aClient underflows or overflows, or XFCNET_INVALID_CLIENT_ID if client is not found, or XFCNET_ERROR otherwise.

XFCIMPORT XFcClientLost* XFcCommunicationHandler::getClientLost   const
 

Sets client lost handler.

Returns:
client lost handling interface.

XFCIMPORT INT32 XFcCommunicationHandler::getConnectionSpeed   const
 

Gets current connection speed.

Returns:
connection speed.

XFCIMPORT INT XFcCommunicationHandler::getConnectionType   const
 

Gets connection type.

Returns:
connection type.

XFCIMPORT INT32 XFcCommunicationHandler::getLastError   const
 

Gets handlers last error.

Returns:
last error set by setLastError().

XFCIMPORT INT32 XFcCommunicationHandler::getMaxClientCount   const
 

Gets maximum client count.

Returns:
max client count, number of client can be added to mClientWinData.

XFCIMPORT XFcUnknownSender* XFcCommunicationHandler::getUnknownSenderHandler  
 

Gets handle of unknown packet sender.

virtual XFCIMPORT INT XFcCommunicationHandler::incoming   [pure virtual]
 

Gets data.

Implemented in XFcBtHandler, and XFcInetHandler.

virtual XFCIMPORT INT XFcCommunicationHandler::outgoing   [pure virtual]
 

Sends data.

Implemented in XFcBtHandler, and XFcInetHandler.

XFCIMPORT XFcClientCommWin* XFcCommunicationHandler::removeClientCommWin INT32    aClient
 

Removes client count window.

Parameters:
aClient client index.
Returns:
client communication window if successful, or NULL otherwise.
Note:
If NULL is returned error value is set.

XFCIMPORT void XFcCommunicationHandler::setClientBaseNumber INT32    aBase
 

Sets base number of client.

XFCIMPORT void XFcCommunicationHandler::setClientLastError INT32    aClient,
INT32    aError
 

Sets client last error.

Parameters:
aClient client identifier.
aError error value.

XFCIMPORT void XFcCommunicationHandler::setClientLost XFcClientLost   aClientLost
 

Sets client lost handler.

Parameters:
aClientLost client lost handling interface.

XFCIMPORT void XFcCommunicationHandler::setConnectionSpeed INT    aSpeedType
 

Sets handlers connection speed.

Parameters:
aSpeedType connection speed enumeration, see XFCNET_CONNECTION_SPEED.
See also:
XFCNET_CONNECTION_SPEED

XFCIMPORT void XFcCommunicationHandler::setConnectionType INT    aType
 

Sets connection type.

Parameters:
aType connection type.

XFCIMPORT void XFcCommunicationHandler::setLastError INT32    aError
 

Sets handlers last error.

Parameters:
aError error value.

XFCIMPORT INT XFcCommunicationHandler::setMaxClientCount INT32    aClientCount
 

Sets maximum client count.

Parameters:
aClientCount new client count.
Returns:
XFCNET_ARRAYSIZE_OK if new array creation is successful, or XFCNET_ERROR if unsuccessful.
Note:
If XFCNET_ERROR is returned error value is set and client table is not changed.

XFCIMPORT void XFcCommunicationHandler::setUnknownSenderHandler XFcUnknownSender   aHandler
 

Sets handler for unknown packet sender.

Parameters:
aHandler interface for handling unknown data sender.

XFCIMPORT INT32 XFcCommunicationHandler::testAddress const XFcAddress   aAddress
 

Tests incoming packet sender address.

Parameters:
aAddress test address against added clients.
Returns:
client number, index to array.

XFCIMPORT void XFcCommunicationHandler::tuneConnectionSpeed INT32    aSpeed
 

Tunes connection speed directly.

Parameters:
aSpeed new connection speed timerout.

virtual XFCIMPORT void XFcCommunicationHandler::unknownSender const XFcAddress  ,
XFcObjectPacketBase  
[pure virtual]
 

Handles data from unknown address.

Implemented in XFcBtHandler, and XFcInetHandler.


Member Data Documentation

INT XFcCommunicationHandler::mBaseNumber [private]
 

Holds base number for client.

XFcClientLost* XFcCommunicationHandler::mClientLost [protected]
 

Holds connection lost event interface.

XFcClientCommWin** XFcCommunicationHandler::mClientWinData [protected]
 

Holds client array.

INT32 XFcCommunicationHandler::mConnectionSpeed [protected]
 

Connection speed.

INT32 XFcCommunicationHandler::mConnectionType [private]
 

Holds connection type, e.g. INET, IRDA, BLUETOOTH.

INT32 XFcCommunicationHandler::mLastError [private]
 

Holds communication handlers last error, argument is initialized to XFCNET_ERROR.

INT XFcCommunicationHandler::mMaxClientCount [private]
 

Holds maximum client count.

XFcUnknownSender* XFcCommunicationHandler::mUSender [protected]
 

Holds unknown sender, senders address is not known.


   
X-Forge Documentation
Confidential
Copyright © 2002-2003 Fathammer
   
Documentation generated
with doxygen
by Dimitri van Heesch