SaxonC  11.6
Saxon Processor library for C/C++, PHP and Python
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. More...
 
 XdmValue (const XdmValue &other)
 A copy constructor. More...
 
XdmValueaddXdmValueWithType (const char *tStr, const char *val)
 Add an XdmItem to the sequence. More...
 
void addXdmItem (XdmItem *val)
 
void addUnderlyingValue (jobject val)
 
 XdmValue (jobject val, bool arrFlag)
 A Constructor for handling XdmArray - Internal user only. More...
 
 XdmValue (jobject val)
 A Constructor. More...
 
virtual ~XdmValue ()
 Destructor. More...
 
void releaseXdmValue ()
 Delete the XdmValue object and clean up all items in the sequence. Release the underlying JNI object.
 
virtual XdmItemgetHead ()
 Get the first item in the sequence. More...
 
virtual XdmItemitemAt (int n)
 Get the n'th item in the value, counting from zero. More...
 
virtual int size ()
 
virtual const char * toString ()
 Create a string representation of the value. More...
 
int getRefCount ()
 Get the number of references on this XdmValue. More...
 
virtual void incrementRefCount ()
 Increment reference count of this XdmValue - Memory management - Internal use only. More...
 
virtual void decrementRefCount ()
 Decrement reference count of this XdmValue - Memory management - Internal use only. More...
 
virtual jobject getUnderlyingValue ()
 
virtual XDM_TYPE getType ()
 

Protected Member Functions

void initialize ()
 initialize this XdmValue with default values
 

Protected Attributes

char * valueType
 
std::vector< XdmItem * > values
 
int xdmSize
 
int refCount
 

Detailed Description

XdmValue. Value in the XDM data model. A value is a sequence of zero or more items, each item being either an atomic value or a node. This class is a wrapper of the 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 ( jobject  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 ( jobject  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 ( jobject  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

◆ 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

Reimplemented in XdmNode, XdmItem, and XdmAtomicValue.

◆ 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 XdmNode, XdmMap, XdmItem, XdmFunctionItem, XdmAtomicValue, and XdmArray.

◆ getUnderlyingValue()

jobject XdmValue::getUnderlyingValue ( )
virtual

Get Java XdmValue object.

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

Reimplemented in XdmNode, and XdmItem.

◆ 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.

◆ 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

Reimplemented in XdmItem.

◆ 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 XdmNode, XdmMap, XdmItem, and XdmArray.

Member Data Documentation

◆ refCount

int XdmValue::refCount
protected

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

◆ values

std::vector<XdmItem*> XdmValue::values
protected

Cached. XdmItems in the XdmValue

◆ 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: