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

 

LSharable



Overview:

LSharable is a mix-in PowerPlant class that is used for reference counted objects.

Methods :

The methods in this class are:

 

LSharable()  
~LSharable()  
AddUser()  
GetUseCount()  
NoMoreUsers()  
RemoveUser()  

Data Members:

The data members in this class are:

 

mUseCount  
 

Source files:

(Feature Classes)

LSharable.h

LSharable.cp

Ancestors:

LModelObject

LSharable()

Purpose:

The constructor creates objects.

Access :

Public

Prototype:

LSharable();

~LSharable()

Purpose:

The destructor destroys the object.

Access :

Virtual, Protected

Prototype:

virtual ~LSharable();

AddUser()

Purpose:

Add a user to an object.

Access :

Virtual, Public

Prototype:

virtual void AddUser( void*	 inUser);
Parameters:

A pointer to the user.

Return:

None

GetUseCount()

Purpose:

Retrieve the use count of the object.

Access :

Virtual, Public

Prototype:

virtual SInt32 GetUseCount();
Parameters:

None

Return:

The number of users.

NoMoreUsers()

Purpose:

Internal function called when use count drops to zero.

Access :

Virtual, Protected

Prototype:

virtual void NoMoreUsers();
Parameters:

None

Return:

None

RemoveUser()

Purpose:

Specify that a user is no longer sharing a Sharable object. This method ignores the user and just decrements the use count. Override if you wish to keep track users.

NOTE: Do not throw an exception from this method.

Access :

Virtual, Public

Prototype:

virtual void RemoveUser (void* inUser);
Parameters:

A pointer to the user.

Return:

None

mUseCount

Purpose:

The user count.

Access :

Protected

Prototype:

SInt32	mUseCount;

 


[ 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