AlPersistentID
 
 
 

A class for maintaining a persistent ID on an object.

Synopsis

#include <AlPersistentID.h> class AlPersistentID AlPersistentID(); AlPersistentID( AlPersistentID & ); AlPersistentID( int, int = -1, int = -1, int = -1 ); virtual	~AlPersistentID(); AlPersistentID	&operator=( const AlPersistentID& ); void	id( int &, int &, int &, int & ); friend int	operator== (const AlPersistentID &, const AlPersistentID &); friend int	operator!= (const AlPersistentID &, const AlPersistentID &);

Description

Sometimes it may be necessary to maintain a persistent ID on an object. The name of the object is inadequate for this since it may be changed by the user, changed when the file is loaded, and so on.The AlPersistentID remains with the object through storing and retrieving, without ever being changed.

This ID is not unique, however. If the object is copied, or if a wire file is retrieved more than once (into one or several stages) the ID will be shared by all copies of the object.

Note that querying an ID from an object will actually return a copy of the object’s ID. This ensures that the ID for an object does not get changed.

For efficiency, IDs are not created until the first time they are queried. As a result, copies of an object made before its ID is created will not have the same ID as the original object.

AlPersistentID::AlPersistentID()

Description

Constructor that sets the internal values for the ID. In general it is unnecessary to use either of the constructors for this class.

AlPersistentID::AlPersistentID( int value0, int value1, int value2, int value3 )

Description

Copy constructor for the AlPersistentID class. This function creates a new AlPersistentID with the given values.

AlPersistentID::AlPersistentID(AlPersistentID &that)

Description

Copy constructor for the AlPersistentID class. This function creates a new AlPersistentID with the same internal state as the given one.

AlPersistentID::~AlPersistentID()

Description

Destructor for the AlPersistentID class. Any AlPersistentID returned to you by class must be deleted.

AlPersistentID &AlPersistentID::operator=( const AlPersistentID &that )

Description

Assignment operator. This function copies the contents of one ID onto another.

void AlPersistentID::id( int &value0, int &value1, int &value2, int &value3 )

Description

Returns the internal values of this class.