~zorba-coders/zorba/ordpathmsgs

« back to all changes in this revision

Viewing changes to src/store/naive/node_items.h

  • Committer: Tarmac
  • Author(s): Ghislain Fourny, Markos Zaharioudakis
  • Date: 2012-03-28 23:58:23 UTC
  • mfrom: (10663.5.18 treeid-typedef)
  • Revision ID: tarmac-20120328235823-unvlliq9vw6t4lrr
Uses (overridable) typedef and traits for tree ID. Approved: Markos Zaharioudakis, Matthias Brantner

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#include "item_vector.h"
30
30
#include "ordpath.h"
31
31
#include "nsbindings.h" // TODO remove by introducing explicit destructors
 
32
#include "tree_id.h"
 
33
#include "simple_store.h"
32
34
 
33
35
// Note: whether the EMBEDED_TYPE is defined or not is done in store_defs.h
34
36
#ifndef EMBEDED_TYPE
177
179
  mutable long              theRefCount;
178
180
  SYNC_CODE(mutable RCLock  theRCLock;)
179
181
 
180
 
  ulong                     theId;
 
182
  TreeId                    theId;
181
183
  xs_integer                thePos;
182
184
 
183
185
  Collection              * theCollection;
200
202
#endif
201
203
 
202
204
protected:
203
 
  XmlTree(XmlNode* root, ulong id);
 
205
  XmlTree(XmlNode* root, const TreeId& id);
204
206
 
205
207
public:
206
208
  XmlTree();
215
217
 
216
218
  SYNC_CODE(RCLock* getRCLock() const { return &theRCLock; })
217
219
 
218
 
  void setId(ulong id) { theId = id; }
 
220
  void setId(const TreeId& id) { theId = id; }
219
221
 
220
 
  ulong getId() const { return theId; }
 
222
  const TreeId& getId() const { return theId; }
221
223
 
222
224
  ulong getCollectionId() const;
223
225
 
519
521
 
520
522
  XmlTree* getTree() const { return (XmlTree*)theUnion.treeRCPtr; }
521
523
 
522
 
  ulong getTreeId() const { return getTree()->getId(); }
 
524
  const TreeId& getTreeId() const { return getTree()->getId(); }
523
525
 
524
526
  XmlNode* getRoot() const { return getTree()->getRoot(); }
525
527
 
1634
1636
  {
1635
1637
    if (col1 == 0)
1636
1638
    {
1637
 
      ulong tree1 = this->getTreeId();
1638
 
      ulong tree2 = other->getTreeId();
 
1639
      const TreeId& tree1 = this->getTreeId();
 
1640
      const TreeId& tree2 = other->getTreeId();
1639
1641
 
1640
1642
      if (tree1 < tree2)
1641
1643
        return -1;