MXmlEngUserData Class Reference

#include <xml/dom/xmlenguserdata.h>

class MXmlEngUserData
Public Member Functions
pure virtual MXmlEngUserData *CloneL()
pure virtual voidDestroy()
virtual void *ID()

Detailed Description

Defines an interface so that user data can be stored in the DOM tree. Applications that wish to store user data in the DOM tree must wrap the user data in a class that implements this interface.

There are two common patterns for implementors of this interface:

1) Instance-based implementation The implementing class stores the user data. The object can be duplicated with CloneL() to form a new object that duplicates the user data. When Destroy() is called, the user data attached to the object is destroyed, but other duplicates may continue to hold the data.

2) Reference-counted implementation The implementing class points to the user data. The object can be duplicated, but the user data is not duplicated. When Destroy() is called, the object is destroyed, but the user data is not destroyed unless this is the last object referring to this data.

Member Function Documentation

CloneL ( )

MXmlEngUserData *CloneL()[pure virtual]

Make a copy of the the object. Whether this duplicates the data or creates a new object that points to the data is determined by the implementor of this class.

Return Value
Pointer to a copy of this object.
Leave Codes

Destroy ( )

voidDestroy()[pure virtual]

Free memory that is allocated and do other case specific cleanup. Whether this frees the user data depends on the implementation. In a reference-counted implementation, the user data may only be destroyed when Destroy() is called on the last object referring to that data.

ID ( )

void *ID()[inline, virtual]

Gets the id of the object. It is up to the user data provider determine what the result is. Such a "user data identification" may be useful if several types of MXmlEngUserData objects are used.

Return Value
Pointer that somehow identifies the type of MXmlEngUserData (NULL by default)