Xalan-C++ API Reference  1.12.0
Classes | Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
xalanc::XObjectFactory Class Referenceabstract

This class handles the creation of XObjects and manages their lifetime. More...

#include <xalanc/XPath/XObjectFactory.hpp>

Inheritance diagram for xalanc::XObjectFactory:
[legend]

Classes

struct  DeleteXObjectFunctor
 A public functor for use with stl algorithms. More...
 

Public Types

typedef XPathExecutionContext::BorrowReturnMutableNodeRefList BorrowReturnMutableNodeRefList
 
typedef XPathExecutionContext::GetCachedString GetCachedString
 
typedef XPathExecutionContext::GetCachedString GetAndReleaseCachedString
 

Public Member Functions

 XObjectFactory (MemoryManager &theManager)
 
virtual ~XObjectFactory ()
 
MemoryManager & getMemoryManager ()
 
bool returnObject (XObject *theXObject)
 Return an XObject to the factory. More...
 
virtual void reset ()=0
 Reset the instance. More...
 
virtual const XObjectPtr createBoolean (bool theValue)=0
 Create a boolean XObject from a boolean value. More...
 
virtual const XObjectPtr createNodeSet (BorrowReturnMutableNodeRefList &theValue)=0
 Create a node set XObject from a node list. More...
 
virtual const XObjectPtr createNodeSet (XalanNode *theValue)=0
 Create a node set XObject from a node. More...
 
virtual const XObjectPtr createNumber (double theValue)=0
 Create a numeric XObject from a number. More...
 
virtual const XObjectPtr createNumber (const XToken &theValue)=0
 Create a numeric XObject from an XToken. More...
 
virtual const XObjectPtr createString (const XalanDOMString &theValue)=0
 Create a string XObject from a string. More...
 
virtual const XObjectPtr createString (const XalanDOMChar *theValue)=0
 Create a string XObject from a null-terminated array of characters. More...
 
virtual const XObjectPtr createString (const XalanDOMChar *theValue, XalanSize_t theLength)=0
 Create a string XObject from an array of characters. More...
 
virtual const XObjectPtr createString (const XToken &theValue)=0
 Create a string XObject from an XToken. More...
 
virtual const XObjectPtr createStringReference (const XalanDOMString &theValue)=0
 Create a string XObject from a string. More...
 
virtual const XObjectPtr createStringAdapter (const XObjectPtr &theValue, XPathExecutionContext &theExecutionContext)=0
 Create a string XObject that will adapt another XObject to behave like a string. More...
 
virtual const XObjectPtr createString (GetCachedString &theValue)=0
 Create a string XObject from a cached XalanDOMString,. More...
 
virtual const XObjectPtr createUnknown (const XalanDOMString &theValue)=0
 Create an "unknown" XObject from a string. More...
 
virtual void holdReference (XObjectPtr theValue)=0
 Hold a reference to an XObject instance until the factory is reset. More...
 

Protected Member Functions

XObject::eObjectType getRealType (const XObject &theXObject) const
 Return the actual implementation type of an XObject. More...
 
void deleteObject (const XObject *theXObject) const
 Delete a FactoryObject instance. More...
 
virtual bool doReturnObject (XObject *theXObject, bool fInReset=false)=0
 Return an XObject to the factory. More...
 

Friends

struct DeleteXObjectFunctor
 

Detailed Description

This class handles the creation of XObjects and manages their lifetime.

Definition at line 53 of file XObjectFactory.hpp.

Member Typedef Documentation

◆ BorrowReturnMutableNodeRefList

Definition at line 57 of file XObjectFactory.hpp.

◆ GetAndReleaseCachedString

Definition at line 59 of file XObjectFactory.hpp.

◆ GetCachedString

Definition at line 58 of file XObjectFactory.hpp.

Constructor & Destructor Documentation

◆ XObjectFactory()

xalanc::XObjectFactory::XObjectFactory ( MemoryManager &  theManager)

◆ ~XObjectFactory()

virtual xalanc::XObjectFactory::~XObjectFactory ( )
virtual

Member Function Documentation

◆ createBoolean()

virtual const XObjectPtr xalanc::XObjectFactory::createBoolean ( bool  theValue)
pure virtual

Create a boolean XObject from a boolean value.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createNodeSet() [1/2]

virtual const XObjectPtr xalanc::XObjectFactory::createNodeSet ( BorrowReturnMutableNodeRefList theValue)
pure virtual

Create a node set XObject from a node list.

Parameters
theValuevalue used to create object. theValue will be owned by the new XObject.
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createNodeSet() [2/2]

virtual const XObjectPtr xalanc::XObjectFactory::createNodeSet ( XalanNode theValue)
pure virtual

Create a node set XObject from a node.

Parameters
theNOdevalue used to create object.
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createNumber() [1/2]

virtual const XObjectPtr xalanc::XObjectFactory::createNumber ( const XToken theValue)
pure virtual

Create a numeric XObject from an XToken.

The XToken instance must be inexistence for the lifetime of the object.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createNumber() [2/2]

virtual const XObjectPtr xalanc::XObjectFactory::createNumber ( double  theValue)
pure virtual

Create a numeric XObject from a number.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createString() [1/5]

virtual const XObjectPtr xalanc::XObjectFactory::createString ( const XalanDOMChar *  theValue)
pure virtual

Create a string XObject from a null-terminated array of characters.

Parameters
theValuea pointer to the array
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createString() [2/5]

virtual const XObjectPtr xalanc::XObjectFactory::createString ( const XalanDOMChar *  theValue,
XalanSize_t  theLength 
)
pure virtual

Create a string XObject from an array of characters.

Parameters
theValuea pointer to the array @paran theLength the length of the array
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createString() [3/5]

virtual const XObjectPtr xalanc::XObjectFactory::createString ( const XalanDOMString theValue)
pure virtual

Create a string XObject from a string.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createString() [4/5]

virtual const XObjectPtr xalanc::XObjectFactory::createString ( const XToken theValue)
pure virtual

Create a string XObject from an XToken.

The XToken instance must be inexistence for the lifetime of the object.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createString() [5/5]

virtual const XObjectPtr xalanc::XObjectFactory::createString ( GetCachedString theValue)
pure virtual

Create a string XObject from a cached XalanDOMString,.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createStringAdapter()

virtual const XObjectPtr xalanc::XObjectFactory::createStringAdapter ( const XObjectPtr theValue,
XPathExecutionContext theExecutionContext 
)
pure virtual

Create a string XObject that will adapt another XObject to behave like a string.

The XObject holds a reference to the other XObject.

Parameters
theValuevalue used to create object @paran theExecutionContext The current execution context
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createStringReference()

virtual const XObjectPtr xalanc::XObjectFactory::createStringReference ( const XalanDOMString theValue)
pure virtual

Create a string XObject from a string.

The XObject will hold a reference to the supplied string, so the string must be in scope for the lifetime of the instance

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ createUnknown()

virtual const XObjectPtr xalanc::XObjectFactory::createUnknown ( const XalanDOMString theValue)
pure virtual

Create an "unknown" XObject from a string.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implemented in xalanc::XObjectFactoryDefault.

◆ deleteObject()

void xalanc::XObjectFactory::deleteObject ( const XObject theXObject) const
inlineprotected

Delete a FactoryObject instance.

Parameters
theXObjectthe XObject instance to delete.

Definition at line 296 of file XObjectFactory.hpp.

References xalanc::XObject::~XObject().

◆ doReturnObject()

virtual bool xalanc::XObjectFactory::doReturnObject ( XObject theXObject,
bool  fInReset = false 
)
protectedpure virtual

Return an XObject to the factory.

Parameters
theXObjectXObject to be returned
fInResettrue when called during reset().

Implemented in xalanc::XObjectFactoryDefault.

◆ getMemoryManager()

MemoryManager& xalanc::XObjectFactory::getMemoryManager ( )
inline

Definition at line 69 of file XObjectFactory.hpp.

◆ getRealType()

XObject::eObjectType xalanc::XObjectFactory::getRealType ( const XObject theXObject) const
inlineprotected

Return the actual implementation type of an XObject.

Parameters
theXObjectthe XObject

Definition at line 285 of file XObjectFactory.hpp.

References xalanc::XObject::getRealType().

◆ holdReference()

virtual void xalanc::XObjectFactory::holdReference ( XObjectPtr  theValue)
pure virtual

Hold a reference to an XObject instance until the factory is reset.

This is needed in a very few cases when the object lifetime needs to extend after the execution of an XPath expression.

Parameters
theValueThe XObjectPtr instance.

Implemented in xalanc::XObjectFactoryDefault.

◆ reset()

virtual void xalanc::XObjectFactory::reset ( )
pure virtual

Reset the instance.

This invalidates all existing instances created with this XObjectFactory.

Implemented in xalanc::XObjectFactoryDefault.

◆ returnObject()

bool xalanc::XObjectFactory::returnObject ( XObject theXObject)
inline

Return an XObject to the factory.

Parameters
theXObjectThe XObject to be returned
Returns
true if the object belongs to the factory, false if not.

Definition at line 81 of file XObjectFactory.hpp.

Friends And Related Function Documentation

◆ DeleteXObjectFunctor

friend struct DeleteXObjectFunctor
friend

Definition at line 275 of file XObjectFactory.hpp.


The documentation for this class was generated from the following file: