Introduction Manual Class Reference Header Reference

ZCom_NodeEventInterceptor Class Reference

List of all members.

Detailed Description

Interface for intercepting node events.

An application must derive all methods provided in this interface and register the instance of this class with the node in question.

Returning 'false' in one of these callbacks does not influence the behaviour of the node in any way. The only difference is that the event, for which 'false' is returned, won't be available through the normal event interface(ZCom_Node::getNextEvent()) anymore. So if you prefer to handle node events through callbacks instead of polling, register an event interceptor and return 'false' in all of the callbacks. If you return 'true', the events will stack up in the node's eventqueue until the node is deleted or the events are fetched with ZCom_Node::getNextEvent().


Public Member Functions

virtual ZCOM_API bool recFileAborted (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole, ZCom_FileTransID _fid)=0
 The node received a filetransfer abortion notification.
virtual ZCOM_API bool recFileComplete (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole, ZCom_FileTransID _fid)=0
 The node received a filetransfer completion notification.
virtual ZCOM_API bool recFileData (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole, ZCom_FileTransID _fid)=0
 The node received a chunk of filedata.
virtual ZCOM_API bool recFileIncoming (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole, ZCom_FileTransID _fid, ZCom_BitStream &_request)=0
 A remote node wants to send a file.
virtual ZCOM_API bool recInit (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole)=0
 A remote node has linked up with our node.
virtual ZCOM_API bool recRemoved (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole)=0
 A remote node has unlinked from our node.
virtual ZCOM_API bool recSyncRequest (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole)=0
 A remote node has linked up with our node and ZCom_Node::setMustSync() is enabled.
virtual ZCOM_API bool recUserEvent (ZCom_Node *_node, ZCom_ConnID _from, eZCom_NodeRole _remoterole, ZCom_BitStream &_data, zU32 _estimated_time_sent)=0
 An application generated event has been received.


Member Function Documentation

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recUserEvent ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole,
ZCom_BitStream _data,
zU32  _estimated_time_sent
[pure virtual]
 

An application generated event has been received.

Parameters:
_node The node which received the event.
_from The sender's connection ID.
_remoterole Role of the sending node.
_data The actual event data.
_estimated_time_sent gives an msec value trying to estimate the time the event has left the remote ZCom_Control. Execute "ZoidCom::getTime() - _estimated_time_sent" to find out the event's travel time in msecs.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recInit ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole
[pure virtual]
 

A remote node has linked up with our node.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the newly connected node.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
This event is only received if it has been enabled with ZCom_Node::setEventNotification(). For further information refer to eZCom_EventInit.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recSyncRequest ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole
[pure virtual]
 

A remote node has linked up with our node and ZCom_Node::setMustSync() is enabled.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the newly connected node.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
For further information refer to eZCom_EventSyncRequest.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recRemoved ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole
[pure virtual]
 

A remote node has unlinked from our node.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the removed node.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
For further information refer to eZCom_EventRemoved.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recFileIncoming ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole,
ZCom_FileTransID  _fid,
ZCom_BitStream _request
[pure virtual]
 

A remote node wants to send a file.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the sending node.
_fid ID of the filetransfer.
_request Additional data submitted by the sending node.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
For further information refer to eZCom_EventFile_Incoming.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recFileData ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole,
ZCom_FileTransID  _fid
[pure virtual]
 

The node received a chunk of filedata.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the sending node.
_fid ID of the filetransfer.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
For further information refer to eZCom_EventFile_Data.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recFileAborted ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole,
ZCom_FileTransID  _fid
[pure virtual]
 

The node received a filetransfer abortion notification.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the sending node.
_fid ID of the filetransfer.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
For further information refer to eZCom_EventFile_Aborted.

virtual ZCOM_API bool ZCom_NodeEventInterceptor::recFileComplete ZCom_Node _node,
ZCom_ConnID  _from,
eZCom_NodeRole  _remoterole,
ZCom_FileTransID  _fid
[pure virtual]
 

The node received a filetransfer completion notification.

Parameters:
_node The node which received the event.
_from The originator's connection ID.
_remoterole Role of the sending node.
_fid ID of the filetransfer.
Returns:
The callback should return 'true' if it wants to forward the event into the node's incoming event queue. If 'false' is returned the event will be discarded immediately.
For further information refer to eZCom_EventFile_Complete.


This file is part of the documentation for Zoidcom. Documentation copyright © 2004-2008 by Jörg Rüppel. Generated on Sat Aug 16 15:26:50 2008 for Zoidcom by doxygen 1.4.6-NO