~zorba-coders/zorba/ordpathmsgs

« back to all changes in this revision

Viewing changes to src/store/naive/store.cpp

  • 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:
56
56
#include "name_iterator.h"
57
57
#include "document_name_iterator.h"
58
58
#include "pul_primitive_factory.h"
 
59
#include "tree_id_generator.h"
59
60
 
60
61
#include "util/cxx_util.h"
61
62
#include "util/uuid/uuid.h"
103
104
  theIteratorFactory(NULL),
104
105
  theNodeFactory(NULL),
105
106
  thePULFactory(NULL),
 
107
  theTreeIdGeneratorFactory(NULL),
 
108
  theTreeIdGenerator(NULL),
106
109
  theDocuments(DEFAULT_DOCUMENT_SET_SIZE, true),
107
110
  theCollections(0),
108
111
  theIndices(0, NULL, DEFAULT_INDICES_SET_SIZE, true),
160
163
    theNodeFactory = createNodeFactory();
161
164
 
162
165
    thePULFactory = createPULFactory();
 
166
    
 
167
    theTreeIdGeneratorFactory = createTreeIdGeneratorFactory();
 
168
 
 
169
    theTreeIdGenerator = theTreeIdGeneratorFactory->createTreeGenerator();
163
170
 
164
171
    theTraceLevel = store::Properties::instance()->storeTraceLevel();
165
172
 
302
309
      theIteratorFactory = NULL;
303
310
    }
304
311
 
 
312
    if (theTreeIdGeneratorFactory != NULL)
 
313
    {
 
314
      destroyTreeIdGeneratorFactory(theTreeIdGeneratorFactory);
 
315
    }
 
316
 
 
317
    if (theTreeIdGenerator)
 
318
    {
 
319
      delete theTreeIdGenerator;
 
320
      theTreeIdGenerator = NULL;
 
321
    }
 
322
 
305
323
    if (theQNamePool != NULL)
306
324
    {
307
325
      csize numTypes = theSchemaTypeNames.size();
377
395
 
378
396
 
379
397
/*******************************************************************************
 
398
  create a tree id for a new tree that does not belong to any collection.
 
399
********************************************************************************/
 
400
TreeId Store::createTreeId()
 
401
{
 
402
  return theTreeIdGenerator->create();
 
403
}
 
404
 
 
405
 
 
406
/*******************************************************************************
380
407
 
381
408
********************************************************************************/
382
409
void Store::addCollection(store::Collection_t& collection)
1315
1342
  return theTokenizerProvider ?
1316
1343
    theTokenizerProvider : &default_tokenizer_provider();
1317
1344
}
 
1345
 
1318
1346
#endif /* ZORBA_NO_FULL_TEXT */
1319
1347
 
1320
1348
} // namespace store