Project

Profile

Help

Revision 6304fb8b

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fixes and development work

View differences:

latest10/hec/Saxon.C.API/XdmItem.h
19 19

  
20 20
     XdmItem();
21 21

  
22
     XdmItem(jobject);
22
     explicit XdmItem(jobject);
23 23

  
24 24
    XdmItem(const XdmItem &item);
25 25

  
26 26
	
27
    virtual ~XdmItem(){
28
	//std::cerr<<std::endl<<"XdmItem destructor called, refCount"<<getRefCount()<<std::endl;
29
	if(getRefCount()<1){
30
	  if(value !=NULL && proc != NULL && SaxonProcessor::jvmCreatedCPP>0) {
31
			SaxonProcessor::sxn_environ->env->DeleteGlobalRef(value->xdmvalue);
32
	  }
33
	  free(value);
34
	  if(stringValue.empty()) {
35
	    stringValue.clear();
36
	  }
37
        }
38
    }
39

  
40
virtual void incrementRefCount() {
41
		refCount++;
42
		//std::cerr<<"refCount-inc-xdmItem="<<refCount<<" ob ref="<<(this)<<std::endl;
43
	}
44

  
45
virtual void decrementRefCount() {
46
		if (refCount > 0)
47
			refCount--;
48
		//std::cerr<<"refCount-dec-xdmItem="<<refCount<<" ob ref="<<(this)<<std::endl;
49
	}
27
    virtual ~XdmItem();
28

  
29
    virtual void incrementRefCount();
30

  
31
    virtual void decrementRefCount();
50 32
    
51 33
    virtual bool isAtomic();
52 34

  
......
78 60

  
79 61
 /**
80 62
     * Get the first item in the sequence
81
     * @return XdmItem or null if sequence is empty
63
     * @return XdmItem or nullptr if sequence is empty
82 64
     */
83 65
	XdmItem * getHead();
84 66

  
......
87 69
     *
88 70
     * @param n the item that is required, counting the first item in the sequence as item zero
89 71
     * @return the n'th item in the sequence making up the value, counting from zero
90
     * return NULL  if n is less than zero or greater than or equal to the number
72
     * return nullptr  if n is less than zero or greater than or equal to the number
91 73
     *                                    of items in the value
92
     * return NULL if the value is lazily evaluated and the delayed
74
     * return nullptr if the value is lazily evaluated and the delayed
93 75
     *                                    evaluation fails with a dynamic error.
94 76
     */
95 77
	XdmItem * itemAt(int n);

Also available in: Unified diff