Class: TMemberFunctionConnectionTo

Declaration: Notification.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TMemberFunctionConnection

Inherited By:

None.

Purpose:

A derived class of the notifier connection that distributes the notifications to the receiver object by calling a member function on the receiver object. It is templatized by receiver type so as to be type safe. An individual receiver member function can be specified for each different interest. A default member function can be specified to be called when an interest does not have a specific member function to call. There may be many different notification threads, so a receiver object that uses this templatized member function connection must be written to be multithread safe. See also TRequestBasedMemberFunctionConnectionTo.

Instantiation:

Always allocate on the heap.

Deriving Classes:

TMemberFunctionConnectionTo is not intended for deriving.

Concurrency:

Multithread safe.

Resource Use:

No special requirements.

Member Function: TMemberFunctionConnectionTo::TMemberFunctionConnectionTo

  1. TMemberFunctionConnectionTo (AReceiver * theReceiver)
  2. TMemberFunctionConnectionTo (AReceiver * theReceiver, MemberFunction defaultFunction)
  3. TMemberFunctionConnectionTo (AReceiver * theReceiver, MemberFunction defaultFunction, const TInterest &)
  4. TMemberFunctionConnectionTo ()

Interface Category:

API.

Purpose:

  1. Creates a new member function connection with no default notification member function pointer.
  2. Creates a new member function with the specified member function to be used as the default notification handler.
  3. Creates a new member function with the specified member function to be used as the default notification handler and the interest to be added as the initial interest.
  4. Default constructor.
  5. There may be many different notification threads, so a receiver object that uses this templatized member function connection must be written to be multithread safe. See also TRequestBasedMemberFunctionConnectionTo.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Called by the stream-in operators and directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMemberFunctionConnectionTo::~TMemberFunctionConnectionTo

virtual ~ TMemberFunctionConnectionTo ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMemberFunctionConnectionTo::GetReceiver

AReceiver * GetReceiver () const

Interface Category:

API.

Purpose:

Gets the object that will receive the notifications.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the receiver object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMemberFunctionConnectionTo::GetDefaultFunction

MemberFunction GetDefaultFunction () const

Interface Category:

API.

Purpose:

Gets the member function that will be invoked on the receiver to handle a notification associated with an interest that does not have its own special notification handler member function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the default notification handler member function.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMemberFunctionConnectionTo::SetReceiver

  1. void SetReceiver (AReceiver * theReceiver)
  2. void SetReceiver (AReceiver * theReceiver, MemberFunction defaultFunction)

Interface Category:

API.

Purpose:

  1. Changes the object that will receive the notifications.
  2. Changes the object that will receive the notifications and the default notification handler member function.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMemberFunctionConnectionTo::AddInterest

  1. virtual void AddInterest (const TInterest &)
  2. void AddInterest (const TInterest &, MemberFunction)

Interface Category:

API.

Purpose:

  1. Adds an interest for a notification. A new interest is added by a client of a notifier to express the desire to receive notifications that are generated and that are associated with this interest. If the connection is already connected to the notifier, then the receiver will immediately begin to receive the notifications associated with this interest. The default notification handler member function of the object will be called for notifications associated with this interest.
  2. Adds an interest for a notification. A new interest is added by a client of a notifier to express the desire to receive notifications that are generated and that are associated with this interest. If the connection is already connected to the notifier, then the receiver will immediately begin to receive the notifications associated with this interest. The specified member function will be invoked against the object when notifications associated with this interest arrive.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TMemberFunctionConnectionTo::AdoptInterest

  1. virtual void AdoptInterest (TInterest *)
  2. void AdoptInterest (TInterest *, MemberFunction)

Interface Category:

API.

Purpose:

  1. Adopts an existing interest into the connection's own collection of interests. A new interest is added by a client of a notifier to express the desire to receive notifications that are generated and that are associated with this interest. If the connection is already connected to the notifier, then the receiver will immediately begin to receive the notifications associated with this interest. The default notification handler member function of the object will be called for notifications associated with this interest.
  2. 2.Adopts an existing interest into the connection's own collection of interests. A new interest is added by a client of a notifier to express the desire to receive notifications that are generated and that are associated with this interest. If the connection is already connected to the notifier, then the receiver will immediately begin to receive the notifications associated with this interest. The specified member function will be invoked against the object when notifications associated with this interest arrive.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.