wxXml2Wrapper Class Reference

#include <xml2.h>

Inheritance diagram for wxXml2Wrapper:

wxXml2BaseNode wxXml2Document wxXml2DTD wxXml2Namespace wxXml2Property wxXml2AttrDecl wxXml2ElemDecl wxXml2EntityDecl wxXml2Node List of all members.

Detailed Description

Provides some standard methods for all wxXml2 wrappers.

This class is used as base for all those classes which wrap libxml2 structure with a "_private" member which can be used to hold the reference count. For more info, please read the specific page on this topic (VERY IMPORTANT !).


Public Member Functions

 wxXml2Wrapper ()
 Constructs this wrapper but not its wrapped data.
virtual ~wxXml2Wrapper ()
 The wxXml2Wrapper destructor will free the memory of the underlying libxml2 structure only if it is not linked to any XML tree.
virtual bool IsUnlinked () const =0
 Returns TRUE if this object is unlinked from an XML tree.
virtual bool IsNonEmpty () const =0
 Returns TRUE if the wrapped element is not NULL.
virtual void DestroyIfUnlinked ()
 Destroys the wrapped data if it is unlinked.

Protected Member Functions

virtual void Destroy ()=0
 Destroys the data wrapped by this class freeing its memory.
virtual void SetAsEmpty ()=0
 Sets this element as empty: that is wrapping a NULL pointer.
virtual int & GetPrivate () const =0
 Returns the private member of the wrapped structure.
void ResetRefCount ()
void IncRefCount ()
void DecRefCount ()
int GetRefCount () const
void UnwrappingOld ()
 This function should be called each time the internal pointer of the class is going to be replaced by another one.
void JustWrappedNew ()
 This function should be called each time the internal pointer of the class has been replaced by another one.


Constructor & Destructor Documentation

wxXml2Wrapper::wxXml2Wrapper (  )  [inline]

Constructs this wrapper but not its wrapped data.

virtual wxXml2Wrapper::~wxXml2Wrapper (  )  [inline, virtual]

The wxXml2Wrapper destructor will free the memory of the underlying libxml2 structure only if it is not linked to any XML tree.

To perform this behaviour, the derived class MUST always call the DestroyIfUnlinked function in its destructor (it cannot be called here).


Member Function Documentation

void wxXml2Wrapper::DecRefCount (  )  [inline, protected]

virtual void wxXml2Wrapper::Destroy (  )  [protected, pure virtual]

Destroys the data wrapped by this class freeing its memory.

This function should not try to update the reference count since it should have been already updated by the caller.

Implemented in wxXml2DTD, wxXml2Property, wxXml2Namespace, wxXml2Document, wxXml2BaseNode, and wxXml2Node.

void wxXml2Wrapper::DestroyIfUnlinked (  )  [virtual]

Destroys the wrapped data if it is unlinked.

virtual int& wxXml2Wrapper::GetPrivate (  )  const [protected, pure virtual]

Returns the private member of the wrapped structure.

This function should be used to implement copy constructor and assignment operators.

Implemented in wxXml2DTD, wxXml2Property, wxXml2Namespace, wxXml2Document, and wxXml2BaseNode.

int wxXml2Wrapper::GetRefCount (  )  const [inline, protected]

void wxXml2Wrapper::IncRefCount (  )  [inline, protected]

virtual bool wxXml2Wrapper::IsNonEmpty (  )  const [pure virtual]

Returns TRUE if the wrapped element is not NULL.

Implemented in wxXml2DTD, wxXml2Property, wxXml2Namespace, wxXml2Document, and wxXml2BaseNode.

virtual bool wxXml2Wrapper::IsUnlinked (  )  const [pure virtual]

Returns TRUE if this object is unlinked from an XML tree.

Implemented in wxXml2DTD, wxXml2Property, wxXml2Namespace, wxXml2Document, and wxXml2BaseNode.

void wxXml2Wrapper::JustWrappedNew (  )  [inline, protected]

This function should be called each time the internal pointer of the class has been replaced by another one.

void wxXml2Wrapper::ResetRefCount (  )  [inline, protected]

virtual void wxXml2Wrapper::SetAsEmpty (  )  [protected, pure virtual]

Sets this element as empty: that is wrapping a NULL pointer.

This function *must not* free the memory of the currently wrapped pointer: it must just reset that pointer to NULL. This function is used by DestroyIfUnlinked().

Implemented in wxXml2DTD, wxXml2Property, wxXml2Namespace, wxXml2Document, and wxXml2BaseNode.

void wxXml2Wrapper::UnwrappingOld (  )  [inline, protected]

This function should be called each time the internal pointer of the class is going to be replaced by another one.


The documentation for this class was generated from the following files:
Generated on Thu Sep 28 14:58:02 2006 for wxXml2 by  doxygen 1.4.7