Xalan-C++ API Reference  1.12.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
xalanc::XObjectFactoryDefault Class Reference

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

#include <xalanc/XPath/XObjectFactoryDefault.hpp>

Inheritance diagram for xalanc::XObjectFactoryDefault:
[legend]
Collaboration diagram for xalanc::XObjectFactoryDefault:
[legend]

Public Types

enum  {
  eDefaultXStringBlockSize = 10, eDefaultXNumberBlockSize = 10, eDefaultXNodeSetBlockSize = 10, eDefaultXNodeSetNodeProxyBlockSize = 5,
  eXNumberCacheMax = 40, eXNodeSetCacheMax = 40, eXStringCacheMax = 40, eXResultTreeFragCacheMax = 40
}
 
typedef XNodeSetAllocator::size_type size_type
 
typedef XalanVector< XObject * > XObjectCollectionType
 
typedef XalanVector< XNumber * > XNumberCacheType
 
typedef XalanVector< XNodeSet * > XNodeSetCacheType
 
typedef XalanVector< XString * > XStringCacheType
 
- Public Types inherited from xalanc::XObjectFactory
typedef XPathExecutionContext::BorrowReturnMutableNodeRefList BorrowReturnMutableNodeRefList
 
typedef XPathExecutionContext::GetCachedString GetCachedString
 
typedef XPathExecutionContext::GetCachedString GetAndReleaseCachedString
 

Public Member Functions

 XObjectFactoryDefault (MemoryManager &theManager XALAN_DEFAULT_MEMMGR, size_type theXStringBlockSize=eDefaultXStringBlockSize, size_type theXNumberBlockSize=eDefaultXNumberBlockSize, size_type theXNodeSetBlockSize=eDefaultXNodeSetBlockSize, size_type theXNodeSetNodeProxyBlockSize=eDefaultXNodeSetNodeProxyBlockSize)
 Construct a factory for creating XObjects. More...
 
virtual ~XObjectFactoryDefault ()
 
MemoryManager & getMemoryManager ()
 
virtual void reset ()
 Reset the instance. More...
 
virtual const XObjectPtr createBoolean (bool theValue)
 Create a boolean XObject from a boolean value. More...
 
virtual const XObjectPtr createNodeSet (BorrowReturnMutableNodeRefList &theValue)
 Create a node set XObject from a node list. More...
 
virtual const XObjectPtr createNodeSet (XalanNode *theValue)
 Create a node set XObject from a node. More...
 
virtual const XObjectPtr createNumber (double theValue)
 Create a numeric XObject from a number. More...
 
virtual const XObjectPtr createNumber (const XToken &theValue)
 Create a numeric XObject from an XToken. More...
 
virtual const XObjectPtr createString (const XalanDOMString &theValue)
 Create a string XObject from a string. More...
 
virtual const XObjectPtr createString (const XalanDOMChar *theValue)
 Create a string XObject from a null-terminated array of characters. More...
 
virtual const XObjectPtr createString (const XalanDOMChar *theValue, XalanSize_t theLength)
 Create a string XObject from an array of characters. More...
 
virtual const XObjectPtr createString (const XToken &theValue)
 Create a string XObject from an XToken. More...
 
virtual const XObjectPtr createStringReference (const XalanDOMString &theValue)
 Create a string XObject from a string. More...
 
virtual const XObjectPtr createStringAdapter (const XObjectPtr &theValue, XPathExecutionContext &theExecutionContext)
 Create a string XObject that will adapt another XObject to behave like a string. More...
 
virtual const XObjectPtr createString (GetCachedString &theValue)
 Create a string XObject from a cached XalanDOMString,. More...
 
virtual const XObjectPtr createUnknown (const XalanDOMString &theValue)
 Create an "unknown" XObject from a string. More...
 
virtual void holdReference (XObjectPtr theValue)
 Hold a reference to an XObject instance until the factory is reset. More...
 
- Public Member Functions inherited from xalanc::XObjectFactory
 XObjectFactory (MemoryManager &theManager)
 
virtual ~XObjectFactory ()
 
MemoryManager & getMemoryManager ()
 
bool returnObject (XObject *theXObject)
 Return an XObject to the factory. More...
 

Static Public Member Functions

static XObjectFactoryDefaultcreate (MemoryManager &theManager, size_type theXStringBlockSize=eDefaultXStringBlockSize, size_type theXNumberBlockSize=eDefaultXNumberBlockSize, size_type theXNodeSetBlockSize=eDefaultXNodeSetBlockSize, size_type theXNodeSetNodeProxyBlockSize=eDefaultXNodeSetNodeProxyBlockSize)
 

Protected Member Functions

virtual bool doReturnObject (XObject *theXObject, bool fInReset=false)
 Return an XObject to the factory. More...
 
- Protected Member Functions inherited from xalanc::XObjectFactory
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...
 

Detailed Description

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

Definition at line 58 of file XObjectFactoryDefault.hpp.

Member Typedef Documentation

◆ size_type

Definition at line 75 of file XObjectFactoryDefault.hpp.

◆ XNodeSetCacheType

Definition at line 162 of file XObjectFactoryDefault.hpp.

◆ XNumberCacheType

Definition at line 161 of file XObjectFactoryDefault.hpp.

◆ XObjectCollectionType

Definition at line 160 of file XObjectFactoryDefault.hpp.

◆ XStringCacheType

Definition at line 163 of file XObjectFactoryDefault.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eDefaultXStringBlockSize 
eDefaultXNumberBlockSize 
eDefaultXNodeSetBlockSize 
eDefaultXNodeSetNodeProxyBlockSize 
eXNumberCacheMax 
eXNodeSetCacheMax 
eXStringCacheMax 
eXResultTreeFragCacheMax 

Definition at line 63 of file XObjectFactoryDefault.hpp.

Constructor & Destructor Documentation

◆ XObjectFactoryDefault()

xalanc::XObjectFactoryDefault::XObjectFactoryDefault ( MemoryManager &theManager  XALAN_DEFAULT_MEMMGR,
size_type  theXStringBlockSize = eDefaultXStringBlockSize,
size_type  theXNumberBlockSize = eDefaultXNumberBlockSize,
size_type  theXNodeSetBlockSize = eDefaultXNodeSetBlockSize,
size_type  theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize 
)
explicit

Construct a factory for creating XObjects.

Parameters
theXStringBlockSizeallocation block size
theXNumberBlockSizeallocation block size
theXNodeSetBlockSizeallocation block size

◆ ~XObjectFactoryDefault()

virtual xalanc::XObjectFactoryDefault::~XObjectFactoryDefault ( )
virtual

Member Function Documentation

◆ create()

static XObjectFactoryDefault* xalanc::XObjectFactoryDefault::create ( MemoryManager &  theManager,
size_type  theXStringBlockSize = eDefaultXStringBlockSize,
size_type  theXNumberBlockSize = eDefaultXNumberBlockSize,
size_type  theXNodeSetBlockSize = eDefaultXNodeSetBlockSize,
size_type  theXNodeSetNodeProxyBlockSize = eDefaultXNodeSetNodeProxyBlockSize 
)
static

◆ createBoolean()

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createBoolean ( bool  theValue)
virtual

Create a boolean XObject from a boolean value.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implements xalanc::XObjectFactory.

◆ createNodeSet() [1/2]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createNodeSet ( BorrowReturnMutableNodeRefList theValue)
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

Implements xalanc::XObjectFactory.

◆ createNodeSet() [2/2]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createNodeSet ( XalanNode theValue)
virtual

Create a node set XObject from a node.

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

Implements xalanc::XObjectFactory.

◆ createNumber() [1/2]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createNumber ( const XToken theValue)
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

Implements xalanc::XObjectFactory.

◆ createNumber() [2/2]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createNumber ( double  theValue)
virtual

Create a numeric XObject from a number.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implements xalanc::XObjectFactory.

◆ createString() [1/5]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createString ( const XalanDOMChar *  theValue)
virtual

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

Parameters
theValuea pointer to the array
Returns
pointer to new object

Implements xalanc::XObjectFactory.

◆ createString() [2/5]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createString ( const XalanDOMChar *  theValue,
XalanSize_t  theLength 
)
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

Implements xalanc::XObjectFactory.

◆ createString() [3/5]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createString ( const XalanDOMString theValue)
virtual

Create a string XObject from a string.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implements xalanc::XObjectFactory.

◆ createString() [4/5]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createString ( const XToken theValue)
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

Implements xalanc::XObjectFactory.

◆ createString() [5/5]

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createString ( GetCachedString theValue)
virtual

Create a string XObject from a cached XalanDOMString,.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implements xalanc::XObjectFactory.

◆ createStringAdapter()

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createStringAdapter ( const XObjectPtr theValue,
XPathExecutionContext theExecutionContext 
)
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

Implements xalanc::XObjectFactory.

◆ createStringReference()

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createStringReference ( const XalanDOMString theValue)
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

Implements xalanc::XObjectFactory.

◆ createUnknown()

virtual const XObjectPtr xalanc::XObjectFactoryDefault::createUnknown ( const XalanDOMString theValue)
virtual

Create an "unknown" XObject from a string.

Parameters
theValuevalue used to create object
Returns
pointer to new object

Implements xalanc::XObjectFactory.

◆ doReturnObject()

virtual bool xalanc::XObjectFactoryDefault::doReturnObject ( XObject theXObject,
bool  fInReset = false 
)
protectedvirtual

Return an XObject to the factory.

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

Implements xalanc::XObjectFactory.

◆ getMemoryManager()

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

Definition at line 105 of file XObjectFactoryDefault.hpp.

◆ holdReference()

virtual void xalanc::XObjectFactoryDefault::holdReference ( XObjectPtr  theValue)
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.

Implements xalanc::XObjectFactory.

◆ reset()

virtual void xalanc::XObjectFactoryDefault::reset ( )
virtual

Reset the instance.

This invalidates all existing instances created with this XObjectFactory.

Implements xalanc::XObjectFactory.


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