CrystalSpace

Public API Reference

CS::Network::EventManager::iEventManager Struct Reference

Interface to the network event manager. More...

#include <inetwork/eventmanager.h>

Inheritance diagram for CS::Network::EventManager::iEventManager:

List of all members.

Public Member Functions

virtual ConnectionID Connect (iAddress *address, Protocol p)=0
 Connect to a remote server running on the specified address using the specified protocol.
virtual void Disconnect (ConnectionID)=0
 Terminate the connection identified by the given id.
virtual iSocketManagerGetSocketManager () const =0
 Get the socket manager associated with the event manager for the purpose of resolving addresses.
virtual ConnectionID Listen (iAddress *address, Protocol p)=0
 Listen for remote peers on the given address using the specified protocol.
virtual void Process ()=0
 Manually process events.
virtual void Send (iEvent *e)=0
 Manually send an event to remote peers.
virtual void SetCallback (iEventCallback *callback)=0
 Set the callback which should receive notifications during operation of the event manager.
virtual void SetProcessEvent (csEventID processType)=0
 This function allows you to optionally specify an event type which the event manager will subscribe to locally and during whose processing it'll perform event processing.
virtual bool Subscribe (csEventID const types[], Source source)=0
 Subscribe to the specified event types for the given sources.
virtual bool Subscribe (csEventID type, Source source)=0
 Convenience function to only subscribe to a single event type.
virtual void Unsubscribe (csEventID const types[], Source source)=0
 Unsubscribe from the specified event types for the given sources.
virtual void Unsubscribe (csEventID type, Source source)=0
 Convenience function to only unsubscribe from a single event type.

Detailed Description

Interface to the network event manager.

This class allows you to transmit events from and to remote peers. In order to do so you can either let it subscribe to certain event types which are broadcasted to all known peers unless the "peer" attribute is set which should be a valid ConnectionID for a known peer - in that case the event is only transmitted to the specified peer - or manually send events for which the same rule applies.

Additionally you can subscribe to event types which are to be posted to the event queue upon receival and manually handle unsubscribed events via a callback.

The event manager can act as client and server or a mixture of both depending on whether you're going to listen (as server) or connect to a remote server (as client).

Definition at line 105 of file eventmanager.h.


Member Function Documentation

virtual ConnectionID CS::Network::EventManager::iEventManager::Connect ( iAddress address,
Protocol  p 
) [pure virtual]

Connect to a remote server running on the specified address using the specified protocol.

Addresses are resolved using iSocketManager.

virtual void CS::Network::EventManager::iEventManager::Disconnect ( ConnectionID   )  [pure virtual]

Terminate the connection identified by the given id.

virtual iSocketManager* CS::Network::EventManager::iEventManager::GetSocketManager (  )  const [pure virtual]

Get the socket manager associated with the event manager for the purpose of resolving addresses.

virtual ConnectionID CS::Network::EventManager::iEventManager::Listen ( iAddress address,
Protocol  p 
) [pure virtual]

Listen for remote peers on the given address using the specified protocol.

virtual void CS::Network::EventManager::iEventManager::Process (  )  [pure virtual]

Manually process events.

During processing an attempt is made to accept new connections, receive events from remote sources and send previously queued events to be transmitted to remote peers.

virtual void CS::Network::EventManager::iEventManager::Send ( iEvent e  )  [pure virtual]

Manually send an event to remote peers.

virtual void CS::Network::EventManager::iEventManager::SetCallback ( iEventCallback callback  )  [pure virtual]

Set the callback which should receive notifications during operation of the event manager.

virtual void CS::Network::EventManager::iEventManager::SetProcessEvent ( csEventID  processType  )  [pure virtual]

This function allows you to optionally specify an event type which the event manager will subscribe to locally and during whose processing it'll perform event processing.

See also:
Process
virtual bool CS::Network::EventManager::iEventManager::Subscribe ( csEventID const   types[],
Source  source 
) [pure virtual]

Subscribe to the specified event types for the given sources.

Parameters:
types An array of event types which should be subscribed terminated by CS_EVENTLIST_END.
source The source for which those event types should be subscribed.
See also:
Source
virtual bool CS::Network::EventManager::iEventManager::Subscribe ( csEventID  type,
Source  source 
) [pure virtual]

Convenience function to only subscribe to a single event type.

virtual void CS::Network::EventManager::iEventManager::Unsubscribe ( csEventID const   types[],
Source  source 
) [pure virtual]

Unsubscribe from the specified event types for the given sources.

Parameters:
types An array of event types which should be unsubscribed terminated by CS_EVENTLIST_END.
source The source for which those event types should be subscribed.
See also:
Source
virtual void CS::Network::EventManager::iEventManager::Unsubscribe ( csEventID  type,
Source  source 
) [pure virtual]

Convenience function to only unsubscribe from a single event type.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1