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

An XdmValue represents a value in the XDM data model. More...

#include <XdmValue.h>

Inheritance diagram for XdmValue:
XdmItem XdmAtomicValue XdmFunctionItem XdmNode XdmArray XdmMap

Public Member Functions

 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.
 
virtual XdmItemgetHead ()
 Get the first item in the sequence represented by this XdmValue.
 
virtual XdmItemitemAt (int n)
 Get the n'th item in the sequence, counting from zero.
 
virtual int size ()
 Get the number of items in the sequence.
 
virtual const char * toString (const char *encoding=nullptr)
 Create a string representation of the sequence.
 
int getRefCount ()
 Get the number of references on this XdmValue - internal use only This method is used for internal memory management.
 
virtual void incrementRefCount ()
 Increment reference count of this XdmValue - internal use only This method is used for internal memory management.
 
virtual void decrementRefCount ()
 Decrement reference count of this XdmValue - internal use only This method is used for internal memory management.
 
virtual int64_t getUnderlyingValue ()
 Get the underlying Java XdmValue object - internal use only.
 
virtual XDM_TYPE getType ()
 Get the type of this XDM value.
 
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.
 

Protected Member Functions

void initialize ()
 Initialize this XdmValue with default values.
 

Protected Attributes

char * valueType
 
XdmItem ** values
 
char * relinquished_values
 
int values_cap
 
int xdmSize
 
int refCount
 
int64_t value
 

Detailed Description

An XdmValue represents a value in the XDM data model.

A value is a sequence of zero or more items, each item being an atomic value, a node, or a function item. This class is a wrapper of the XdmValue object created in Java.

Constructor & Destructor Documentation

◆ XdmValue() [1/4]

XdmValue::XdmValue ( )
inline

Default constructor.

Creates an empty XdmValue

◆ XdmValue() [2/4]

XdmValue::XdmValue ( const XdmValue & other)

XdmValue copy constructor.

Parameters
other- XdmValue

◆ XdmValue() [3/4]

XdmValue::XdmValue ( int64_t val,
bool arrFlag )

A Constructor for handling XdmArray - internal use only.

Handles a sequence of XdmValues given as a wrapped an Java XdmValue object.

Parameters
val- Java XdmValue object
arrFlag- Currently not used but allows for overloading of constructor methods

◆ XdmValue() [4/4]

XdmValue::XdmValue ( int64_t val)

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

Parameters
val- internal Java XdmValue object to be wrapped

Member Function Documentation

◆ addUnderlyingValue()

void XdmValue::addUnderlyingValue ( int64_t val)

Add Java XdmValue object to the sequence.

See methods the functions in SaxonCXPath of the C library

Parameters
val- Java object

◆ addXdmItem()

void XdmValue::addXdmItem ( XdmItem * val)

Add an XdmItem to the sequence.

See functions in SaxonCXPath of the C library

Parameters
val- XdmItem object

◆ addXdmItemFromUnderlyingValue()

void XdmValue::addXdmItemFromUnderlyingValue ( XdmItem * val)

Add an XdmItem to the sequence, when the sequence was returned from SaxonC - internal use only.

Parameters
val- XdmItem object

◆ decrementRefCount()

void XdmValue::decrementRefCount ( )
virtual

Decrement reference count of this XdmValue - internal use only This method is used for internal memory management.

Reimplemented in XdmItem.

◆ getHead()

XdmItem * XdmValue::getHead ( )
virtual

Get the first item in the sequence represented by this XdmValue.

Returns
The first XdmItem in the sequence, or nullptr if the sequence is empty. Pointers to XdmItem objects have to be deleted in the calling program. The caller is responsible for memory deallocation.

Reimplemented in XdmAtomicValue, XdmItem, and XdmNode.

◆ getType()

XDM_TYPE XdmValue::getType ( )
virtual

Get the type of this XDM value.

Returns
The type of the XdmValue as an XDM_TYPE

Reimplemented in XdmArray, XdmAtomicValue, XdmFunctionItem, XdmItem, XdmMap, and XdmNode.

◆ getUnderlyingValue()

int64_t XdmValue::getUnderlyingValue ( )
virtual

Get the underlying Java XdmValue object - internal use only.

Returns
The Graalvm reference to the Java object of the XdmValue.

Reimplemented in XdmItem, and XdmNode.

◆ incrementRefCount()

void XdmValue::incrementRefCount ( )
virtual

Increment reference count of this XdmValue - internal use only This method is used for internal memory management.

Reimplemented in XdmItem.

◆ itemAt()

XdmItem * XdmValue::itemAt ( int n)
virtual

Get the n'th item in the sequence, counting from zero.

Parameters
n- the item that is required, counting the first item in the sequence as item zero
Returns
The n'th item in the sequence making up the XdmValue, counting from zero. Returns nullptr if n is less than zero or greater than or equal to the number of items in the value. Pointers to XdmItem objects have to be deleted in the calling program. The caller is responsible for memory deallocation.

Reimplemented in XdmItem.

◆ releaseXdmValue()

void XdmValue::releaseXdmValue ( )

Deprecated: this is deprecated and a no-op, the C++ destructor handles this case.

Delete the XdmValue object and clean up all items in the sequence. Release the underlying JNI object.

Deprecated

◆ size()

int XdmValue::size ( )
virtual

Get the number of items in the sequence.

Returns
The number of items in the XdmValue.

Reimplemented in XdmItem.

◆ toString()

const char * XdmValue::toString ( const char * encoding = nullptr)
virtual

Create a string representation of the sequence.

This is the result of serializing the sequence using the adaptive serialization method.

Parameters
encoding- the encoding of the string returned. If NULL or omitted defaults to the JVM encoding, which in most cases is UTF-8.
Returns
A string representation of the XdmValue. The caller is responsible for memory deallocation using operator delete.
Exceptions
SaxonApiExceptionif encoding cannot be recognized

Reimplemented in XdmArray, XdmItem, XdmMap, and XdmNode.

Member Data Documentation

◆ refCount

int XdmValue::refCount
protected

The reference count of this XdmValue. If >1 this object should not be deleted

◆ relinquished_values

char* XdmValue::relinquished_values
protected

Pointer to the array of items which have been relinquished

◆ value

int64_t XdmValue::value
protected

The Java XdmItem reference in Graalvm

◆ values

XdmItem** XdmValue::values
protected

Cached. XdmItems in the XdmValue

◆ values_cap

int XdmValue::values_cap
protected

The number of items in the value

◆ valueType

char* XdmValue::valueType
protected

Cached. The type of the XdmValue

◆ xdmSize

int XdmValue::xdmSize
protected

Cached. The number of items in the XdmValue


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