Class: TViewActionDistributor

Declaration: ActionDistributor.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TActionDistributor

Inherited By:

None.

Purpose:

TViewActionDistributor distributes actions up the view hierarchy, passing the action to each MActionTarget it finds until one of them returns true. If none of the targets return true and the top of the hierarchy is reached, then the action is deleted. The TViewActionDistributor dispatches the action to any adopted MEventTarget behaviors, if they are also MActionTargets, before giving the action to the view and it only gives the action to the view if the action was not handled by a behavior. An MEventTarget behavior is any MEventTarget that has been adopted into the view via the MEventTarget::AdoptBehavior(MEventTarget*) member function. This means you can add action handling behavior to a view without having to derive the view and mix in MActionTarget and MViewActionHandler, etc. TViewActionDistributor can distribute any type of TAction, not just view actions.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Use TActionDistributor to derive classes that support distribution policies which you define.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TViewActionDistributor::TViewActionDistributor

TViewActionDistributor (TAction * adoptedAction, TViewHandle startingView)

Interface Category:

API.

Purpose:

Creates a TViewActionDistributor with the adopted action and starting view.

Calling Context:

Called to construct TViewActionDistributor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewActionDistributor::~TViewActionDistributor

virtual ~ TViewActionDistributor ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewActionDistributor::Do

virtual void Do ()

Interface Category:

API.

Purpose:

Actually does the distribution of the action according to the algorithm described in the class description.

Calling Context:

Called to distribute the action.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewActionDistributor::GetStartingView

virtual TView * GetStartingView () const

Interface Category:

API.

Purpose:

Returns a reference to the starting view for this TViewActionDistributor.

Calling Context:

Called to obtain a reference to the starting view for this TViewActionDistributor.

Parameters:

Return Value:

Returns a reference to the starting view for this TViewActionDistributor.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewActionDistributor::SetStartingView

virtual void SetStartingView (TViewHandle handle)

Interface Category:

API.

Purpose:

Sets the starting view for this TViewActionDistributor.

Calling Context:

Called to set the starting view for this TViewActionDistributor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TViewActionDistributor::PostAction

static void PostAction (TViewHandle startingView, TAction * action)

Interface Category:

API.

Purpose:

A convenience function that creates a view action distributor, initializes it with the passed parameters and posts the action to the request processor.

Calling Context:

Called to create a view action handler and post an action to the request processor.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not 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.