## Xalan-C++ API Documentation

### The Xalan C++ XSLT Processor Version 1.9

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# XObjectFactory Class Reference

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

Inheritance diagram for XObjectFactory:

[legend]
List of all members.

## Public Types

- typedef XPathExecutionContext::BorrowReturnMutableNodeRefList BorrowReturnMutableNodeRefList
- typedef XPathExecutionContext::GetAndReleaseCachedString GetAndReleaseCachedString

## Public Member Functions

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

## Protected Member Functions

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

## Friends

- struct DeleteXObjectFunctor

## Detailed Description

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

## Member Typedef Documentation

typedef XPathExecutionContext::BorrowReturnMutableNodeRefList XObjectFactory::BorrowReturnMutableNodeRefList

typedef XPathExecutionContext::GetAndReleaseCachedString XObjectFactory::GetAndReleaseCachedString

## Constructor & Destructor Documentation

XObjectFactory::XObjectFactory | ( | MemoryManagerType & | theManager | ) |

virtual XObjectFactory::~XObjectFactory | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual const XObjectPtr XObjectFactory::createBoolean | ( | bool | theValue | ) | `[pure virtual]`

Create a boolean XObject from a boolean value.

Parameters:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createNodeSet | ( | XalanNode * | theValue | ) | `[pure virtual]`

Create a node set XObject from a node.

Parameters:

  theNOde | value used to create object.

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createNodeSet | ( | BorrowReturnMutableNodeRefList & | theValue | ) | `[pure virtual]`

Create a node set XObject from a node list.

Parameters:

  theValue | value used to create object. theValue will be owned by the new XObject.

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createNull | ( |  | ) | `[pure virtual]`

Create a null XObject.

Parameters:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr 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:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createNumber | ( | double | theValue | ) | `[pure virtual]`

Create a numeric XObject from a number.

Parameters:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createString | ( | GetAndReleaseCachedString & | theValue | ) | `[pure virtual]`

Create a string XObject from a cached XalanDOMString,.

Parameters:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr 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:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createString | ( | const XalanDOMChar * | theValue,
|  | unsigned int | theLength
| ) | `[pure virtual]`

Create a string XObject from an array of characters.

Parameters:

  theValue | a pointer to the array theLength the length of the array

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createString | ( | const XalanDOMChar * | theValue | ) | `[pure virtual]`

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

Parameters:

  theValue | a pointer to the array

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createString | ( | const XalanDOMString & | theValue | ) | `[pure virtual]`

Create a string XObject from a string.

Parameters:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createStringAdapter | ( | const XObjectPtr & | theValue | ) | `[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:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr 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:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

virtual const XObjectPtr XObjectFactory::createUnknown | ( | const XalanDOMString & | theValue | ) | `[pure virtual]`

Create an "unknown" XObject from a string.

Parameters:

  theValue | value used to create object

Returns:
  pointer to new object

Implemented in XObjectFactoryDefault.

void XObjectFactory::deleteObject | ( | const XObject * | theXObject | ) | const`[protected]`

Delete a FactoryObject instance.

Parameters:

  theXObject | the XObject instance to delete.

virtual bool XObjectFactory::doReturnObject | ( | XObject * | theXObject,
|  | bool | fInReset = false
| ) | `[protected, pure virtual]`

Return an XObject to the factory.

Parameters:

  theXObject | XObject to be returned
  fInReset | true when called during reset().

Implemented in XObjectFactoryDefault.

MemoryManagerType& XObjectFactory::getMemoryManager | ( |  | ) |

| Reimplemented in XObjectFactoryDefault.

XObject::eObjectType XObjectFactory::getRealType | ( | const XObject & | theXObject | ) | const`[protected]`

Return the actual implementation type of an XObject.

Parameters:

  theXObject | the XObject

virtual void XObjectFactory::reset | ( |  | ) | `[pure virtual]`

| Reset the instance. This invalidates all existing instances created with this XObjectFactory. Implemented in XObjectFactoryDefault.

bool XObjectFactory::returnObject | ( | XObject * | theXObject | ) |

Return an XObject to the factory.

Parameters:

  theXObject | The XObject to be returned

Returns:
  true if the object belongs to the factory, false if not.

## Friends And Related Function Documentation

friend struct DeleteXObjectFunctor `[friend]`

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

- XObjectFactory.hpp

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.9 Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.