SaxonC 12.7.0
Saxon Processor library for C/C++, PHP and Python
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
XdmFunctionItem Class Reference

The class XdmFunctionItem represents a function item. More...

#include <XdmFunctionItem.h>

Inheritance diagram for XdmFunctionItem:
XdmItem XdmValue XdmArray XdmMap

Public Member Functions

 XdmFunctionItem ()
 Default constructor.
 
 XdmFunctionItem (int64_t obj)
 XdmFunctionItem constructor to create an object which is a wrapper for a Java XdmFunctionItem object - internal use only.
 
 XdmFunctionItem (const XdmFunctionItem &d)
 XdmFunctionItem copy constructor.
 
virtual ~XdmFunctionItem ()
 Destructor method for XdmFunctionItem.
 
const char * getName ()
 Get the name of the function as an EQName.
 
virtual int getArity ()
 Get the arity of the function.
 
const char * getStringValue (const char *encoding=nullptr)
 Get the string value of the XdmFunctionItem.
 
XdmValuecall (SaxonProcessor *processor, XdmValue **arguments, int argument_length)
 Call the function.
 
bool isAtomic ()
 Determine whether the item is an atomic value or some other type of item.
 
XDM_TYPE getType ()
 Get the type of this XDM value.
 
bool isFunction ()
 Determine whether the item is a function or some other type of item.
 
- Public Member Functions inherited from XdmItem
 XdmItem ()
 Default constructor.
 
 XdmItem (int64_t objRef)
 XdmItem constructor to create an object which is a wrapper for a Java XdmItem object - internal use only.
 
 XdmItem (const XdmItem &item)
 XdmItem copy constructor.
 
bool operator== (const XdmItem &other) const
 
virtual ~XdmItem ()
 Destructor method for XdmItem.
 
virtual void incrementRefCount ()
 Increment reference count of this XdmItem - internal use only.
 
virtual void decrementRefCount ()
 Decrement reference count of this XdmItem - internal use only.
 
virtual bool isNode ()
 Determine whether the item is a node or some other type of item.
 
virtual bool isMap ()
 Determine whether the item is an XDM map or some other type of item.
 
virtual bool isArray ()
 Determine whether the item is an XDM array or some other type of item.
 
virtual int64_t getUnderlyingValue ()
 Get the underlying Java XdmValue object - internal use only.
 
const char * toString (const char *encoding=nullptr)
 Create a string representation of the item.
 
virtual XdmItemgetHead ()
 Get the first item in the sequence consisting of just this item.
 
XdmItemitemAt (int n)
 Get the n'th item in the sequence consisting of just this item, counting from zero.
 
int size ()
 Get the number of items in the sequence.
 
- Public Member Functions inherited from XdmValue
 XdmValue ()
 Default constructor.
 
 XdmValue (const XdmValue &other)
 XdmValue copy constructor.
 
void addXdmItem (XdmItem *val)
 Add an XdmItem to the sequence.
 
virtual bool operator== (const XdmValue &other) const
 
void addXdmItemFromUnderlyingValue (XdmItem *val)
 Add an XdmItem to the sequence, when the sequence was returned from SaxonC - internal use only.
 
void addUnderlyingValue (int64_t val)
 Add Java XdmValue object to the sequence.
 
 XdmValue (int64_t val, bool arrFlag)
 A Constructor for handling XdmArray - internal use only.
 
 XdmValue (int64_t val)
 XdmValue constructor to create an object which is a wrapper for a Java XdmValue object - internal use only.
 
virtual ~XdmValue ()
 Destructor method for XdmValue.
 
void releaseXdmValue ()
 Deprecated: this is deprecated and a no-op, the C++ destructor handles this case.
 
int getRefCount ()
 Get the number of references on this XdmValue - internal use only This method is used for internal memory management.
 
void resetRelinquishedItems ()
 Reset associated reference counts on XdmItems that have been relinquished - internal use only.
 
void incrementRefCountForRelinquishedValue (int i)
 Increment the ref count for a relinquished item only once - internal use only.
 

Static Public Member Functions

static XdmFunctionItemgetSystemFunction (SaxonProcessor *processor, const char *name, int arity)
 Get a system function.
 

Protected Member Functions

XdmValuegetXdmValueSubClass (int64_t value)
 
- Protected Member Functions inherited from XdmValue
void initialize ()
 Initialize this XdmValue with default values.
 

Protected Attributes

char * fname
 
- Protected Attributes inherited from XdmItem
const char * stringValue
 
const char * itemToString
 
- Protected Attributes inherited from XdmValue
char * valueType
 
XdmItem ** values
 
char * relinquished_values
 
int values_cap
 
int xdmSize
 
int refCount
 
int64_t value
 

Detailed Description

The class XdmFunctionItem represents a function item.

Constructor & Destructor Documentation

◆ XdmFunctionItem() [1/3]

XdmFunctionItem::XdmFunctionItem ( )

Default constructor.

Creates an empty XdmFunctionItem

◆ XdmFunctionItem() [2/3]

XdmFunctionItem::XdmFunctionItem ( int64_t obj)

XdmFunctionItem constructor to create an object which is a wrapper for a Java XdmFunctionItem object - internal use only.

Parameters
obj- internal Java XdmFunctionItem object to be wrapped

◆ XdmFunctionItem() [3/3]

XdmFunctionItem::XdmFunctionItem ( const XdmFunctionItem & d)

XdmFunctionItem copy constructor.

Parameters
d- XdmFunctionItem

Member Function Documentation

◆ call()

XdmValue * XdmFunctionItem::call ( SaxonProcessor * processor,
XdmValue ** arguments,
int argument_length )

Call the function.

Parameters
processor- the SaxonProcessor object required in the call of the function
arguments- the values to be supplied as arguments to the function. The "function conversion rules" will be applied to convert the arguments to the required type when necessary.
argument_length- the length of the array of arguments
Returns
The result of calling the function. The caller is responsible for memory deallocation.

◆ getArity()

int XdmFunctionItem::getArity ( )
virtual

Get the arity of the function.

Returns
The arity of the function, that is, the number of arguments in the function's signature

Reimplemented in XdmArray.

◆ getName()

const char * XdmFunctionItem::getName ( )

Get the name of the function as an EQName.

The expanded name, as a string using the notation devised by EQName. If the name is in a namespace, the resulting string takes the form Q{uri}local. Otherwise, the value is the local part of the name.

Returns
The function name as a string in the EQName notation, or null for an anonymous inline function item. The caller is responsible for memory deallocation using operator delete.

◆ getStringValue()

const char * XdmFunctionItem::getStringValue ( const char * encoding = nullptr)
virtual

Get the string value of the XdmFunctionItem.

There is no string value for function items, so an exception is always thrown.

Returns
Nothing is returned; this method always throws an exception because the XdmFunctionItem has no associated string value.
Exceptions
SaxonApiException

Reimplemented from XdmItem.

◆ getSystemFunction()

XdmFunctionItem * XdmFunctionItem::getSystemFunction ( SaxonProcessor * processor,
const char * name,
int arity )
static

Get a system function.

This can be any function defined in XPath 3.1 functions and operators, including functions in the math, map, and array namespaces. It can also be a Saxon extension function, provided a licensed Processor is used.

Parameters
processor- the Saxon Processor object required to get the system function
name- the name of the function
arity- the number of arguments in the function
Returns
The requested function, or null if there is no such function. Note that some functions (those with particular context dependencies) may be unsuitable for dynamic calling. The caller is responsible for memory deallocation.

◆ getType()

XDM_TYPE XdmFunctionItem::getType ( )
inlinevirtual

Get the type of this XDM value.

Returns
The type of the XdmValue as an XDM_TYPE

Reimplemented from XdmItem.

Reimplemented in XdmMap.

◆ getXdmValueSubClass()

XdmValue * XdmFunctionItem::getXdmValueSubClass ( int64_t value)
protected

Creates the right type of result value

◆ isAtomic()

bool XdmFunctionItem::isAtomic ( )
inlinevirtual

Determine whether the item is an atomic value or some other type of item.

Returns
False

Reimplemented from XdmItem.

◆ isFunction()

bool XdmFunctionItem::isFunction ( )
inlinevirtual

Determine whether the item is a function or some other type of item.

Returns
True

Reimplemented from XdmItem.

Reimplemented in XdmMap.

Member Data Documentation

◆ fname

char* XdmFunctionItem::fname
protected

The name of the function item


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