[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

 

LAttachment



Description:

LAttachment is a PowerPlant class that is used for forming relataionships between objects. An Attachment is usually an object that modifies the runtime behavior of another object.

Methods :

The methods in this class are:

 

LAttachment()  
~LAttachment()  
Execute()  
ExecuteSelf()  
GetExecuteHost()  
GetMessage()  
GetOwnerHost()  
SetExecuteHost()  
SetMessage()  
SetOwnerHost()  

Data Members:

The data members in this class are:

 

mOwnerHost  
mMessage  
mExecuteHost  
 

Operation:

The concept of an Attachment is a powerful underlying concept of PowerPlant's inner workings. For a detailed discussion on this topic, refer to The PowerPlant Book.

Source files:

(Feature Classes)

LAttachment.h

LAttachment.cp

See also:

LAttachable

LPaintAttachment

LYieldAttachment

LAttachment()

Purpose:

The constructors create the object and initialize the data members to the passed-in values.

Access:

Public

Prototype:

LAttachment( MessageT inMessage,
Boolean inExecuteHost);


LAttachment( LStream *inStream );
Parameters:

The parameters for the constructors are:

 

MessageT  
inMessage  
The value to set mMessage to.  
Boolean  
inExecuteHost  
The value to set mExecuteHost to.  
LStream*  
inStream  
The data in Stream must be:  
  • MessageT-Message that Attachment responds to.
  • Boolean-Should we execute the Host? (mExecuteHost)
  • Boolean-Does the Host own this object? (mOwnerHost)

~LAttachment()

Purpose:

The destructor destroys the object, removing itself from any Attachments.

Access:

Virtual, Public

Prototype:

virtual ~LAttachment();
Parameters:

None

Execute()

Purpose:

If the message passed to this method is the message for which the Attachment is designed, this method calls ExecuteSelf().

Access:

Virtual, Public

Prototype:

virtual Boolean Execute( MessageT inMessage,
void *ioParam);
Parameters:

This method has the following parameters:

 

MessageT  
inMessage  
The message to which the attachment responds.  
void*  
ioParam  
A pointer to the host attachable object.  

Return:

A Boolean with the value of mExecuteHost. The PowerPlant framework uses this value to decide whether the host object should also perform the task in question.

Remarks:

You do not typically need to override this function.

ExecuteSelf()

Purpose:

This method performs the attachment task. You typically want to override this method in your class that inherits from LAttachment.

Access:

Virtual, Public

Prototype:

void ExecuteSelf(MessageT inMessage, 
void* ioParam );
Parameters:

This method has the following parameters:

 

MessageT  
inMessage  
The message to which the attachment responds.  
void*  
ioParam  
A pointer to the host attachable object.  

Return:

None

Remarks:

To get an idea of how to implement this method in your class override, look at classes like LPaintAttachment to see how it is implemented.

GetExecuteHost()

Purpose:

This method is an accessor for the value of mExecuteHost.

Access:

Inline, Public

Prototype:

Boolean GetExecuteHost();
Parameters:

None

Return:

A Boolean indicating the value of mExecuteHost.

GetMessage()

Purpose:

This method is an accessor for the value of mMessage.

Access:

Public, Inline

Prototype:

MessageT GetMessage();
Parameters:

None

Return:

A MessageT indicating the value of mMessage.

GetOwnerHost()

Purpose:

This method is an accessor for the value of mOwnerHost.

Access:

Public, Inline

Prototype:

LAttachable* GetOwnerHost();
Parameters:

None

Return:

An LAttachable pointer indicating the value of mOwnerHost.

SetExecuteHost()

Purpose:

Sets the value of mExecuteHost, that specifies whether the host action should execute after executing all Attachments.

Access:

Virtual, Public

Prototype:

void SetExecuteHost( Boolean inExecuteHost );
Parameters:

This method takes a Boolean to assign to mExecuteHost.

Return:

None

SetMessage()

Purpose:

Sets the value of mMessage.

Access:

Virtual, Public

Prototype:

void SetMessage( MessageT inMessage );
Parameters:

A MessageT to assign to mMessage.

Return:

None

SetOwnerHost()

Purpose:

Sets the value of mOwnerHost.

Access:

Virtual, Public

Prototype:

void SetOwnerHost( LAttachable *inHost );
Parameters:

A pointer to an LAttachable to assign to mOwnerHost.

Return:

None

mOwnerHost

Purpose:

This data member points to the host attachable object.

Access:

Protected

Prototype:

LAttachable *mOwnerHost;

mMessage

Purpose:

This data member contains the message value to which the attachable object responds.

Access:

Protected

Prototype:

MessageT mMessage;

mExecuteHost

Purpose:

This data member indicates whether or not to execute the host object action.

Access:

Protected

Prototype:

Boolean mExecuteHost;

 


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: July 21, 2000