System CATEventSubscriber

Usage: you can derive this class.


public class CATEventSubscriber

Base class for event publishers and subscribers.
Role: Objects that publish events and objects that subscribe to published events can derive from CATEventSubscriber. Preferably, use the global methods to add and remove callbacks to event subscribers.

See also:
, , , , ,


Constructor and Destructor Index


o CATEventSubscriber()
Constructs an event subscriber.
o ~CATEventSubscriber()

Method Index


o AddCallback(CATBaseUnknown*,CATCallbackEvent,CATSubscriberMethod,CATSubscriberData)
Adds a callback for a given event published by a given event publisher.
o GetCallbackManager()
Returns an event publisher's callback manager.
o RemoveCallback(CATBaseUnknown*,CATCallback)
Removes a callback with a given identifier from a given event publisher.
o RemoveCallbacksOn(CATBaseUnknown*,CATCallbackEvent,CATSubscriberData)
Removes all the callbacks from a given event published by a given event publisher.
o RemoveSubscriberCallbacks(CATBaseUnknown*)
Removes all the callbacks for all events published by a given event publisher.

Constructor and Destructor


o CATEventSubscriber
public CATEventSubscriber()
Constructs an event subscriber.
o ~CATEventSubscriber
public ~CATEventSubscriber()

Methods


o AddCallback
public virtual AddCallback( iEventPublisher,
iPublishedEvent,
iMethodToCall,
iClientData=NULL)
Adds a callback for a given event published by a given event publisher.
Role: The current event subscriber subscribes to a given event that is published by a given event publisher. Whenever this event is published by this event publisher, the method declared when subscribing is called, along with possible useful data.
Parameters:
iEventPublisher
A pointer to the object that is expected to publish the event
iPublishedEvent
The event in question published by iEventPublisher
iMethodToCall
The subscriber's method to call whenever iEventPublisher publishes iPublishedEvent
iClientData
Useful data to pass as an argument of iMethodToCall.
Returns:
The identifier of the created callback.
o GetCallbackManager
public virtual GetCallbackManager()
Returns an event publisher's callback manager.
Warning: Do not redefine this method.
o RemoveCallback
public virtual RemoveCallback( iEventPublisher,
iCallback)
Removes a callback with a given identifier from a given event publisher.
Role: The current event subscriber resigns its subscription to a given event publisher made thanks to a given callback.
Parameters:
iEventPublisher
A pointer to the object from which the callback iCallback is to be removed
iCallback
The identifier of the callback to remove.
Legal values: This identifier was returned by the
method.
o RemoveCallbacksOn
public virtual RemoveCallbacksOn( iEventPublisher,
iPublishedEvent,
iClientData)
Removes all the callbacks from a given event published by a given event publisher.
Role: The current event subscriber resigns its subscription to all the callbacks set for a given event published by a given event publisher, and with a given client data pointer.
Parameters:
iEventPublisher
A pointer to the object from which the callback iCallback is to be removed
iPublishedEvent
The event in question published by iEventPublisher
iClientData
Useful data to pass as an argument of the method called
o RemoveSubscriberCallbacks
public virtual RemoveSubscriberCallbacks( iEventPublisher)
Removes all the callbacks for all events published by a given event publisher.
Role: The current event subscriber resigns its subscription to all the callbacks set for all the events published by a given event publisher.
Parameters:
iEventPublisher
A pointer to the object from which all the callbacks are to be removed.

This object is included in the file: CATEventSubscriber.h
If needed, your Imakefile.mk should include the module: JS0GROUP

Copyright © 1999-2015, Dassault Systèmes. All rights reserved.