Saxon/C  1.1.2
Saxon Processor library for C/C++/PHP
 All Classes Functions Variables
XdmItem.h
1 // Copyright (c) 2015 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
7 
8 #ifndef SAXON_XDMITEM_h
9 #define SAXON_XDMITEM_h
10 
11 #include "XdmValue.h"
12 
13 class SaxonProcessor;
14 
15 class XdmItem : public XdmValue
16 {
17 
18 public:
19 
20  XdmItem();
21 
22  XdmItem(jobject);
23 
24  XdmItem(const XdmItem &item);
25 
26 
27  virtual ~XdmItem(){
28 //std::cerr<<std::endl<<"XdmItem destructor called, refCount"<<getRefCount()<<std::endl;
29  if(value !=NULL && proc != NULL && SaxonProcessor::jvmCreatedCPP>0) {
30  SaxonProcessor::sxn_environ->env->DeleteLocalRef(value->xdmvalue);
31  }
32  free(value);
33  }
34 
35  virtual bool isAtomic();
36 
37 //TODO: isNode
38 //TODO: isFunction
39 
44  virtual jobject getUnderlyingValue();
45 
46  sxnc_value * getUnderlyingCValue(){
47  return value;
48  }
49 
50  virtual const char * getStringValue(SaxonProcessor * proc=NULL);
51 
56  XdmItem * getHead();
57 
68  XdmItem * itemAt(int n);
69 
74  int size();
75 
76 
77 
81  virtual XDM_TYPE getType();
82 
83  protected:
84  sxnc_value* value;
85 };
86 
87 
88 #endif
Definition: XdmValue.h:44
Definition: SaxonProcessor.h:290
Definition: XdmItem.h:15
XdmItem * itemAt(int n)
Definition: XdmItem.cpp:33
Definition: SaxonCXPath.h:12
virtual XDM_TYPE getType()
Definition: XdmItem.cpp:70
virtual jobject getUnderlyingValue()
Definition: XdmItem.cpp:46
int size()
Definition: XdmItem.cpp:42
XdmItem * getHead()
Definition: XdmItem.cpp:31