SaxonC 12.5
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

#include <XdmValue.h>

Inheritance diagram for XdmValue:
XdmItem XdmAtomicValue XdmFunctionItem XdmNode XdmArray XdmMap

Public Member Functions

 XdmValue ()
 A default Constructor.
 
 XdmValue (const XdmValue &other)
 A copy constructor.
 
XdmValueaddXdmValueWithType (const char *tStr, const char *val)
 Add an XdmItem to the sequence.
 
void addXdmItem (XdmItem *val)
 
void addXdmItemFromUnderlyingValue (XdmItem *val)
 
void addUnderlyingValue (int64_t val)
 
 XdmValue (int64_t val, bool arrFlag)
 A Constructor for handling XdmArray - Internal user only.
 
 XdmValue (int64_t val)
 A Constructor.
 
virtual ~XdmValue ()
 Destructor.
 
void releaseXdmValue ()
 
virtual XdmItemgetHead ()
 Get the first item in the sequence.
 
virtual XdmItemitemAt (int n)
 Get the n'th item in the value, counting from zero.
 
virtual int size ()
 
virtual const char * toString ()
 Create a string representation of the value.
 
int getRefCount ()
 Get the number of references on this XdmValue.
 
virtual void incrementRefCount ()
 
virtual void decrementRefCount ()
 
virtual int64_t getUnderlyingValue ()
 
virtual XDM_TYPE getType ()
 
void resetRelinquishedItems ()
 
void incrementRefCountForRelinquishedValue (int i)
 

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
 

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

A default Constructor.

Create a empty value

◆ XdmValue() [2/4]

XdmValue::XdmValue ( const XdmValue & other)

A copy constructor.

Parameters
other- XdmValue

◆ XdmValue() [3/4]

XdmValue::XdmValue ( int64_t val,
bool arrFlag )

A Constructor for handling XdmArray - Internal user 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)

A Constructor.

Wrap a Java XdmValue object.

Parameters
val- Java XdmValue object

◆ ~XdmValue()

XdmValue::~XdmValue ( )
virtual

Destructor.

Destructor for this XdmValue

Member Function Documentation

◆ addUnderlyingValue()

void XdmValue::addUnderlyingValue ( int64_t val)

Add an 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

◆ addXdmValueWithType()

XdmValue * XdmValue::addXdmValueWithType ( const char * tStr,
const char * val )

Add an XdmItem to the sequence.

This method is designed for the primitive types.

Parameters
tStr- specify target type of the value
val- Value to convert

◆ decrementRefCount()

void XdmValue::decrementRefCount ( )
virtual

Decrement reference count of this XdmValue - Memory management - 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.

Returns
XdmItem or nullptr if sequence is empty Pointer to XdmItem objects have to be deleted in the calling program.

Reimplemented in XdmAtomicValue, XdmItem, and XdmNode.

◆ getRefCount()

int XdmValue::getRefCount ( )
inline

Get the number of references on this XdmValue.

This method is used for internal memory management.

◆ getType()

XDM_TYPE XdmValue::getType ( )
virtual

Get the type of the object

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

◆ getUnderlyingValue()

int64_t XdmValue::getUnderlyingValue ( )
virtual

Get Java XdmValue object.

Returns
jobject - The Java object of the XdmValue in its JNI representation

Reimplemented in XdmItem, and XdmNode.

◆ incrementRefCount()

void XdmValue::incrementRefCount ( )
virtual

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

Reimplemented in XdmItem.

◆ incrementRefCountForRelinquishedValue()

void XdmValue::incrementRefCountForRelinquishedValue ( int i)

Internal method used to increment the ref count for an relinquished item only once

◆ itemAt()

XdmItem * XdmValue::itemAt ( int n)
virtual

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

Parameters
nthe 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 value, counting from zero return nullptr if n is less than zero or greater than or equal to the number of items in the value. Pointer to XdmItem objects have to be deleted in the calling program.

Reimplemented in XdmItem.

◆ releaseXdmValue()

void XdmValue::releaseXdmValue ( )

This is deprecated and a no-op, C++ destructor handles this case. Delete the XdmValue object and clean up all items in the sequence. Release the underlying JNI object.

◆ resetRelinquishedItems()

void XdmValue::resetRelinquishedItems ( )

Internal method used to reset associated reference counts on xdmItems that have been relinquished

◆ size()

int XdmValue::size ( )
virtual

Get the number of items in the sequence

Reimplemented in XdmItem.

◆ toString()

const char * XdmValue::toString ( )
virtual

Create a string representation of the value.

The is the result of serializing the value using the adaptive serialization method.

Returns
a string representation of the value

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

◆ values

XdmItem** XdmValue::values
protected

Cached. XdmItems in the XdmValue

◆ values_cap

int XdmValue::values_cap
protected

The count of items in the value

◆ valueType

char* XdmValue::valueType
protected

Cached. The type of the XdmValue

◆ xdmSize

int XdmValue::xdmSize
protected

Cached. The count of items in the XdmValue


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