~zorba-coders/zorba/ordpathmsgs

« back to all changes in this revision

Viewing changes to src/store/naive/store.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:
19
19
#include "shared_types.h"
20
20
#include "store_defs.h"
21
21
#include "hashmap_nodep.h"
 
22
#include "tree_id.h"
22
23
 
23
24
#if (defined (WIN32) || defined (WINCE))
24
25
#include "node_items.h"
59
60
class BasicItemFactory;
60
61
class NodeFactory;
61
62
class PULPrimitiveFactory;
 
63
class TreeIdGeneratorFactory;
 
64
class TreeIdGenerator;
62
65
 
63
66
typedef zorba::HashMapZString<XmlNode_t> DocumentSet;
64
67
typedef ItemPointerHashMap<store::Index_t> IndexSet;
75
78
  theSchemaTypeCodes:
76
79
  -------------------
77
80
 
 
81
  theNumUsers:
 
82
  ------------
 
83
 
78
84
  theNamespacePool:
79
85
  -----------------
80
86
 
93
99
  ---------------
94
100
  Factory to create node items.
95
101
 
 
102
  theTreeIdGeneratorFactory:
 
103
  --------------------------
 
104
  Factory to create ID generators (Each collection can have its own ID generator in
 
105
  addition to the default one).
 
106
 
 
107
  theTreeIdGenerator:
 
108
  -------------------
 
109
  The tree-id generator used by the store for trees that are not in collections.
 
110
 
96
111
  theDocuments:
97
112
  -------------
98
113
  A hashmap that for each xml tree that does not belong to any collection, maps
150
165
  store::IteratorFactory      * theIteratorFactory;
151
166
  NodeFactory                 * theNodeFactory;
152
167
  PULPrimitiveFactory         * thePULFactory;
 
168
  TreeIdGeneratorFactory      * theTreeIdGeneratorFactory;
 
169
  
 
170
  TreeIdGenerator             * theTreeIdGenerator;
153
171
 
154
172
  DocumentSet                   theDocuments;
155
173
  CollectionSet*                theCollections;
200
218
 
201
219
  PULPrimitiveFactory& getPULFactory() const { return *thePULFactory; }
202
220
 
 
221
  TreeIdGeneratorFactory& getTreeIdGeneratorFactory() const
 
222
  {
 
223
    return *theTreeIdGeneratorFactory;
 
224
  }
 
225
 
203
226
  StringPool& getNamespacePool() const { return *theNamespacePool; }
204
227
 
205
228
  QNamePool& getQNamePool() const { return *theQNamePool; }
206
 
  
 
229
 
207
230
protected:
208
231
  // Functions to create/destory the node and item factories. These functions
209
232
  // are called from init and shutdown, respectively. Having this functionality
230
253
 
231
254
  virtual void destroyCollectionSet(CollectionSet*) const = 0;
232
255
 
 
256
  virtual TreeIdGeneratorFactory* createTreeIdGeneratorFactory() const = 0;
 
257
 
 
258
  virtual void destroyTreeIdGeneratorFactory(TreeIdGeneratorFactory*) const = 0;
 
259
 
233
260
/*---------------------------- Collections -----------------------------------*/
234
261
public:
235
262
  virtual ulong createCollectionId() = 0;
236
263
 
237
 
  virtual ulong createTreeId() = 0;
 
264
  virtual TreeId createTreeId();
238
265
 
239
266
  virtual store::Collection_t createCollection(
240
267
      const store::Item_t& aName,