~ubuntu-branches/ubuntu/raring/clucene-core/raring-proposed

« back to all changes in this revision

Viewing changes to src/CLucene/search/FieldCacheImpl.cpp

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2012-08-11 09:33:38 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120811093338-fgrx41ftqew3qt6a
Tags: 2.3.3.4-1
* New upstream release (Closes: #661703).
* Convert package to multiarch.
* Drop obsolete patches:
  - 01_add_missing_include_bug505667.diff
  - 02_posixness_fix_bug530308.diff
* Add patches:
  - Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
  - Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
  - Install-contribs-lib.patch
  - multiarch.patch
* Update debian/compat: bump to 8.
* Update debian/control:
  - update build dependencies (add cmake, libboost-dev and libz-dev).
  - bump Standards-Version to 3.9.3.
  - rename packages due to ABI bump: libclucene0ldbl -> libclucene-core1.
  - add libclucene-contribs1 package.
* Update debian/rules:
  - rewrite to use CMake.
  - add multiarch support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*------------------------------------------------------------------------------
2
 
* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
3
 
4
 
* Distributable under the terms of either the Apache License (Version 2.0) or 
5
 
* the GNU Lesser General Public License, as specified in the COPYING file.
6
 
------------------------------------------------------------------------------*/
7
 
#include "CLucene/StdHeader.h"
8
 
#include "FieldCacheImpl.h"
9
 
 
10
 
CL_NS_USE(util)
11
 
CL_NS_USE(index)
12
 
CL_NS_DEF(search)
13
 
 
14
 
FieldCacheImpl::FieldCacheImpl():
15
 
    cache(false,true){
16
 
}
17
 
FieldCacheImpl::~FieldCacheImpl(){
18
 
    cache.clear();
19
 
}
20
 
 
21
 
FieldCacheImpl::FileEntry::FileEntry (const TCHAR* field, int32_t type) {
22
 
   this->field = CLStringIntern::intern(field CL_FILELINE);
23
 
   this->type = type;
24
 
   this->custom = NULL;
25
 
   this->_hashCode = 0;
26
 
 }
27
 
 
28
 
 /** Creates one of these objects for a custom comparator. */
29
 
 FieldCacheImpl::FileEntry::FileEntry (const TCHAR* field, SortComparatorSource* custom) {
30
 
   this->field = CLStringIntern::intern(field CL_FILELINE);
31
 
   this->type = SortField::CUSTOM;
32
 
   this->custom = custom;
33
 
   this->_hashCode = 0;
34
 
 }
35
 
 FieldCacheImpl::FileEntry::~FileEntry(){
36
 
   CLStringIntern::unintern(field);
37
 
 }
38
 
 
39
 
 size_t FieldCacheImpl::FileEntry::hashCode(){
40
 
        if ( _hashCode == 0 ){
41
 
    //todo: cache hashcode?
42
 
     size_t ret = Misc::thashCode(field);
43
 
     if ( custom != NULL )
44
 
         ret = ret ^ custom->hashCode();
45
 
     ret = ret ^ (type*7); //type with a seed
46
 
             _hashCode = ret;
47
 
    }
48
 
     return _hashCode;
49
 
 }
50
 
 int32_t FieldCacheImpl::FileEntry::compareTo(const FieldCacheImpl::FileEntry* other) const{
51
 
     if ( other->field == this->field ){
52
 
         if ( other->type == this->type ){
53
 
            if ( other->custom == NULL ){
54
 
                if ( this->custom == NULL )
55
 
                    return 0; //both null
56
 
                else
57
 
                    return 1;
58
 
            }else if ( this->custom == NULL )
59
 
                return -1;
60
 
            else if ( other->custom < this->custom )
61
 
                return -1;
62
 
            else if ( other->custom > this->custom )
63
 
                return 1;
64
 
            else
65
 
                return 0;
66
 
         }else if ( other->type > this->type )
67
 
             return 1;
68
 
         else
69
 
             return -1;
70
 
             
71
 
     }else
72
 
         return _tcscmp(other->field,this->field);
73
 
 }
74
 
 
75
 
 /** Two of these are equal iff they reference the same field and type. */
76
 
 /*bool FieldCacheImpl::FileEntry::equals (FileEntry* other) {
77
 
      if (other->field == field && other->type == type) {
78
 
       if (other->custom == NULL) {
79
 
         if (custom == NULL)
80
 
          return true;
81
 
       } else if (other->custom->equals (custom)) {
82
 
         return true;
83
 
       }
84
 
     }
85
 
 }*/
86
 
 
87
 
 /** Composes a hashcode based on the field and type. */
88
 
 /*size_t FieldCacheImpl::FileEntry::hashCode() {
89
 
   return field->hashCode() ^ type ^ (custom==NULL ? 0 : custom->hashCode());
90
 
 }*/
91
 
 
92
 
 
93
 
 
94
 
 
95
 
 
96
 
  /** See if an object is in the cache. */
97
 
  FieldCacheAuto* FieldCacheImpl::lookup (IndexReader* reader, const TCHAR* field, int32_t type) {
98
 
    FieldCacheAuto* ret = NULL;
99
 
    FileEntry* entry = _CLNEW FileEntry (field, type);
100
 
    {
101
 
        SCOPED_LOCK_MUTEX(THIS_LOCK)
102
 
        fieldcacheCacheReaderType* readerCache = cache.get(reader);
103
 
        if (readerCache != NULL) 
104
 
          ret = readerCache->get (entry);
105
 
        _CLDELETE(entry);
106
 
        }
107
 
    return ret;
108
 
  }
109
 
 
110
 
 
111
 
  /** See if a custom object is in the cache. */
112
 
  FieldCacheAuto* FieldCacheImpl::lookup (IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer) {
113
 
    FieldCacheAuto* ret = NULL;
114
 
    FileEntry* entry = _CLNEW FileEntry (field, comparer);
115
 
    {
116
 
        SCOPED_LOCK_MUTEX(THIS_LOCK)
117
 
        fieldcacheCacheReaderType* readerCache = cache.get(reader);
118
 
        if (readerCache != NULL)
119
 
                ret = readerCache->get (entry);
120
 
        _CLDELETE(entry);
121
 
}
122
 
    return ret;
123
 
  }
124
 
  
125
 
        void FieldCacheImpl::closeCallback(CL_NS(index)::IndexReader* reader, void* fieldCacheImpl){
126
 
                FieldCacheImpl* fci = (FieldCacheImpl*)fieldCacheImpl;
127
 
        SCOPED_LOCK_MUTEX(fci->THIS_LOCK)
128
 
                fci->cache.remove(reader);
129
 
        }
130
 
 
131
 
  /** Put an object into the cache. */
132
 
  void FieldCacheImpl::store (IndexReader* reader, const TCHAR* field, int32_t type, FieldCacheAuto* value) {
133
 
    FileEntry* entry = _CLNEW FileEntry (field, type);
134
 
    {
135
 
        SCOPED_LOCK_MUTEX(THIS_LOCK)
136
 
          fieldcacheCacheReaderType* readerCache = cache.get(reader);
137
 
          if (readerCache == NULL) {
138
 
            readerCache = _CLNEW fieldcacheCacheReaderType;
139
 
            cache.put(reader,readerCache);
140
 
            reader->addCloseCallback(closeCallback, this);
141
 
          }
142
 
          readerCache->put (entry, value);
143
 
         //this is supposed to return the previous value, but it needs to be deleted!!!
144
 
    }
145
 
  }
146
 
 
147
 
  /** Put a custom object into the cache. */
148
 
  void FieldCacheImpl::store (IndexReader* reader, const TCHAR* field, SortComparatorSource* comparer, FieldCacheAuto* value) {
149
 
    FileEntry* entry = _CLNEW FileEntry (field, comparer);
150
 
    {
151
 
      SCOPED_LOCK_MUTEX(THIS_LOCK)
152
 
      fieldcacheCacheReaderType* readerCache = cache.get(reader);
153
 
      if (readerCache == NULL) {
154
 
        readerCache = _CLNEW fieldcacheCacheReaderType;
155
 
        cache.put(reader, readerCache);
156
 
                reader->addCloseCallback(FieldCacheImpl::closeCallback, this);
157
 
      }
158
 
      readerCache->put(entry, value);
159
 
          //this is supposed to return the previous value, but it needs to be deleted!!!
160
 
        }
161
 
  }
162
 
  
163
 
  
164
 
  
165
 
 
166
 
 
167
 
 // inherit javadocs
168
 
 FieldCacheAuto* FieldCacheImpl::getInts (IndexReader* reader, const TCHAR* field) {
169
 
    field = CLStringIntern::intern(field CL_FILELINE);
170
 
    FieldCacheAuto* ret = lookup (reader, field, SortField::INT);
171
 
    if (ret == NULL) {
172
 
      int32_t retLen = reader->maxDoc();
173
 
      int32_t* retArray = _CL_NEWARRAY(int32_t,retLen);
174
 
          memset(retArray,0,sizeof(int32_t)*retLen);
175
 
      if (retLen > 0) {
176
 
        TermDocs* termDocs = reader->termDocs();
177
 
 
178
 
                Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false);
179
 
        TermEnum* termEnum = reader->terms (term);
180
 
                _CLDECDELETE(term);
181
 
        try {
182
 
          if (termEnum->term(false) == NULL) {
183
 
                         _CLTHROWA(CL_ERR_Runtime,"no terms in field"); //todo: add detailed error:  + field);
184
 
          }
185
 
          do {
186
 
            Term* term = termEnum->term(false);
187
 
            if (term->field() != field) 
188
 
                                break;
189
 
    
190
 
                        TCHAR* end;
191
 
            int32_t termval = (int32_t)_tcstoi64(term->text(), &end, 10);
192
 
            termDocs->seek (termEnum);
193
 
            while (termDocs->next()) {
194
 
              retArray[termDocs->doc()] = termval;
195
 
            }
196
 
          } while (termEnum->next());
197
 
        } _CLFINALLY(
198
 
          termDocs->close();
199
 
          _CLDELETE(termDocs);
200
 
          termEnum->close();
201
 
          _CLDELETE(termEnum);
202
 
        )
203
 
      }
204
 
 
205
 
          FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::INT_ARRAY);
206
 
          fa->intArray = retArray;
207
 
 
208
 
      store (reader, field, SortField::INT, fa);
209
 
          CLStringIntern::unintern(field);
210
 
      return fa;
211
 
    }
212
 
        CLStringIntern::unintern(field);
213
 
    return ret;
214
 
  }
215
 
 
216
 
  // inherit javadocs
217
 
  FieldCacheAuto* FieldCacheImpl::getFloats (IndexReader* reader, const TCHAR* field){
218
 
        field = CLStringIntern::intern(field CL_FILELINE);
219
 
    FieldCacheAuto* ret = lookup (reader, field, SortField::FLOAT);
220
 
    if (ret == NULL) {
221
 
          int32_t retLen = reader->maxDoc();
222
 
      float_t* retArray = _CL_NEWARRAY(float_t,retLen);
223
 
          memset(retArray,0,sizeof(float_t)*retLen);
224
 
      if (retLen > 0) {
225
 
        TermDocs* termDocs = reader->termDocs();
226
 
 
227
 
                Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false);
228
 
        TermEnum* termEnum = reader->terms (term);
229
 
                _CLDECDELETE(term);
230
 
 
231
 
        try {
232
 
          if (termEnum->term(false) == NULL) {
233
 
            _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: make richer error + field);
234
 
          }
235
 
          do {
236
 
            Term* term = termEnum->term(false);
237
 
            if (term->field() != field) 
238
 
                                break;
239
 
 
240
 
                        TCHAR* tmp;
241
 
            float_t termval = _tcstod(term->text(),&tmp);
242
 
            termDocs->seek (termEnum);
243
 
            while (termDocs->next()) {
244
 
              retArray[termDocs->doc()] = termval;
245
 
            }
246
 
          } while (termEnum->next());
247
 
        } _CLFINALLY(
248
 
          termDocs->close();
249
 
          _CLDELETE(termDocs);
250
 
          termEnum->close();
251
 
          _CLDELETE(termEnum);
252
 
        )
253
 
      }
254
 
          
255
 
          FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::FLOAT_ARRAY);
256
 
          fa->floatArray = retArray;
257
 
 
258
 
      store (reader, field, SortField::FLOAT, fa);
259
 
          CLStringIntern::unintern(field);
260
 
      return fa;
261
 
    }
262
 
        CLStringIntern::unintern(field);
263
 
    return ret;
264
 
  }
265
 
 
266
 
 
267
 
  // inherit javadocs
268
 
  FieldCacheAuto* FieldCacheImpl::getStrings (IndexReader* reader, const TCHAR* field){
269
 
   //todo: this is not really used, i think?
270
 
        field = CLStringIntern::intern(field CL_FILELINE);
271
 
    FieldCacheAuto* ret = lookup (reader, field, SortField::STRING);
272
 
    if (ret == NULL) {
273
 
          int32_t retLen = reader->maxDoc();
274
 
      TCHAR** retArray = _CL_NEWARRAY(TCHAR*,retLen+1);
275
 
      memset(retArray,0,sizeof(TCHAR*)*(retLen+1));
276
 
      if (retLen > 0) {
277
 
        TermDocs* termDocs = reader->termDocs();
278
 
 
279
 
                Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false);
280
 
        TermEnum* termEnum = reader->terms (term);
281
 
                _CLDECDELETE(term);
282
 
 
283
 
        try {
284
 
          if (termEnum->term(false) == NULL) {
285
 
            _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: extend to + field);
286
 
          }
287
 
          do {
288
 
            Term* term = termEnum->term(false);
289
 
            if (term->field() != field) 
290
 
                                break;
291
 
            const TCHAR* termval = term->text();
292
 
            termDocs->seek (termEnum);
293
 
            while (termDocs->next()) {
294
 
              retArray[termDocs->doc()] = STRDUP_TtoT(termval); //todo: any better way of doing this???
295
 
            }
296
 
          } while (termEnum->next());
297
 
        } _CLFINALLY(
298
 
                  retArray[retLen]=NULL;
299
 
          termDocs->close();
300
 
          _CLDELETE(termDocs);
301
 
          termEnum->close();
302
 
          _CLDELETE(termEnum);
303
 
        )
304
 
      }
305
 
 
306
 
          
307
 
          FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::STRING_ARRAY);
308
 
          fa->stringArray = retArray;
309
 
          fa->ownContents=true;
310
 
      store (reader, field, SortField::STRING, fa);
311
 
          CLStringIntern::unintern(field);
312
 
      return fa;
313
 
    }
314
 
        CLStringIntern::unintern(field);
315
 
    return ret;
316
 
  }
317
 
 
318
 
  // inherit javadocs
319
 
  FieldCacheAuto* FieldCacheImpl::getStringIndex (IndexReader* reader, const TCHAR* field){
320
 
        field = CLStringIntern::intern(field CL_FILELINE);
321
 
    FieldCacheAuto* ret = lookup (reader, field, STRING_INDEX);
322
 
    int32_t t = 0;  // current term number
323
 
    if (ret == NULL) {
324
 
          int32_t retLen = reader->maxDoc();
325
 
      int32_t* retArray = _CL_NEWARRAY(int32_t,retLen);
326
 
          memset(retArray,0,sizeof(int32_t)*retLen);
327
 
 
328
 
      TCHAR** mterms = _CL_NEWARRAY(TCHAR*,retLen+2);
329
 
      mterms[0]=NULL;
330
 
      if ( retLen > 0 ) {
331
 
        TermDocs* termDocs = reader->termDocs();
332
 
 
333
 
                Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false);
334
 
        TermEnum* termEnum = reader->terms (term);
335
 
                _CLDECDELETE(term);
336
 
 
337
 
 
338
 
                CND_PRECONDITION(t+1 <= retLen, "t out of bounds");
339
 
 
340
 
        // an entry for documents that have no terms in this field
341
 
        // should a document with no terms be at top or bottom?
342
 
        // this puts them at the top - if it is changed, FieldDocSortedHitQueue
343
 
        // needs to change as well.
344
 
        mterms[t++] = NULL;
345
 
 
346
 
        try {
347
 
          if (termEnum->term(false) == NULL) {
348
 
            _CLTHROWA(CL_ERR_Runtime,"no terms in field"); //todo: make rich message " + field);
349
 
          }
350
 
          do {
351
 
            Term* term = termEnum->term(false);
352
 
            if (term->field() != field) 
353
 
                                break;
354
 
 
355
 
            // store term text
356
 
            // we expect that there is at most one term per document
357
 
            if (t >= retLen+1) 
358
 
                                _CLTHROWA(CL_ERR_Runtime,"there are more terms than documents in field"); //todo: rich error \"" + field + "\"");
359
 
            mterms[t] = STRDUP_TtoT(term->text());
360
 
 
361
 
            termDocs->seek (termEnum);
362
 
            while (termDocs->next()) {
363
 
              retArray[termDocs->doc()] = t;
364
 
            }
365
 
 
366
 
            t++;
367
 
          } while (termEnum->next());
368
 
                  CND_PRECONDITION(t<retLen+2,"t out of bounds");
369
 
                  mterms[t] = NULL;
370
 
        } _CLFINALLY(
371
 
          termDocs->close();
372
 
                  _CLDELETE(termDocs);
373
 
          termEnum->close();
374
 
                  _CLDELETE(termEnum);
375
 
        );
376
 
 
377
 
        if (t == 0) {
378
 
          // if there are no terms, make the term array
379
 
          // have a single NULL entry
380
 
                  _CLDELETE_ARRAY(mterms);
381
 
          mterms = _CL_NEWARRAY(TCHAR*,1); //todo: delete old mterms?
382
 
                  mterms[0]=NULL;
383
 
        } else if (t < retLen) { //todo: check, was mterms.length
384
 
          // if there are less terms than documents,
385
 
          // trim off the dead array space
386
 
          //const TCHAR** terms = _CL_NEWARRAY(TCHAR,t);
387
 
          //System.arraycopy (mterms, 0, terms, 0, t);
388
 
                  //mterms = terms;
389
 
 
390
 
                  //we simply shorten the length of the array...
391
 
          
392
 
        }
393
 
      }
394
 
      FieldCache::StringIndex* value = _CLNEW FieldCache::StringIndex (retArray, mterms,t);
395
 
          
396
 
          FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::STRING_INDEX);
397
 
          fa->stringIndex = value;
398
 
          fa->ownContents=true;
399
 
      store (reader, field, STRING_INDEX, fa);
400
 
          CLStringIntern::unintern(field);
401
 
      return fa;
402
 
    }
403
 
        CLStringIntern::unintern(field);
404
 
    return ret;
405
 
  }
406
 
 
407
 
  // inherit javadocs
408
 
  FieldCacheAuto* FieldCacheImpl::getAuto (IndexReader* reader, const TCHAR* field) {
409
 
        field = CLStringIntern::intern(field CL_FILELINE);
410
 
    FieldCacheAuto* ret = lookup (reader, field, SortField::AUTO);
411
 
    if (ret == NULL) {
412
 
          Term* term = _CLNEW Term (field, LUCENE_BLANK_STRING, false);
413
 
      TermEnum* enumerator = reader->terms (term);
414
 
          _CLDECDELETE(term);
415
 
 
416
 
      try {
417
 
        Term* term = enumerator->term(false);
418
 
        if (term == NULL) {
419
 
          _CLTHROWA(CL_ERR_Runtime,"no terms in field - cannot determine sort type"); //todo: make rich error: " + field + " 
420
 
        }
421
 
        if (term->field() == field) {
422
 
          const TCHAR* termtext = term->text();
423
 
                  size_t termTextLen = term->textLength();
424
 
 
425
 
                  bool isint=true;
426
 
                  for ( size_t i=0;i<termTextLen;i++ ){
427
 
                          if ( _tcschr(_T("0123456789 +-"),termtext[i]) == NULL ){
428
 
                                isint = false;
429
 
                                break;
430
 
                          }
431
 
                  }
432
 
                  if ( isint )
433
 
                          ret = getInts (reader, field);
434
 
                  else{
435
 
                          bool isfloat=true;
436
 
 
437
 
                          int32_t searchLen = termTextLen;
438
 
                          if ( termtext[termTextLen-1] == 'f' )
439
 
                                  searchLen--;
440
 
                          for ( int32_t i=0;i<searchLen;i++ ){
441
 
                                  if ( _tcschr(_T("0123456789 Ee.+-"),termtext[i]) == NULL ){
442
 
                                        isfloat = false;
443
 
                                        break;
444
 
                                  }
445
 
                          }
446
 
                          if ( isfloat )
447
 
                                  ret = getFloats (reader, field);
448
 
                          else{
449
 
                                  ret = getStringIndex (reader, field);
450
 
                          }
451
 
                  }
452
 
 
453
 
          if (ret != NULL) {
454
 
                          store (reader, field, SortField::AUTO, ret);
455
 
          }
456
 
        } else {
457
 
          _CLTHROWA (CL_ERR_Runtime,"field does not appear to be indexed"); //todo: make rich error: \"" + field + "\" 
458
 
        }
459
 
      } _CLFINALLY( enumerator->close(); _CLDELETE(enumerator) );
460
 
 
461
 
    }
462
 
        CLStringIntern::unintern(field);
463
 
    return ret;
464
 
  }
465
 
   
466
 
 
467
 
  // inherit javadocs
468
 
  FieldCacheAuto* FieldCacheImpl::getCustom (IndexReader* reader, const TCHAR* field, SortComparator* comparator){
469
 
        field = CLStringIntern::intern(field CL_FILELINE);
470
 
 
471
 
    FieldCacheAuto* ret = lookup (reader, field, comparator);
472
 
    if (ret == NULL) {
473
 
          int32_t retLen = reader->maxDoc();
474
 
      Comparable** retArray = _CL_NEWARRAY(Comparable*,retLen);
475
 
          memset(retArray,0,sizeof(Comparable*)*retLen); 
476
 
      if (retLen > 0) {
477
 
        TermDocs* termDocs = reader->termDocs();
478
 
        TermEnum* termEnum = reader->terms ();
479
 
 
480
 
        try {
481
 
          if (termEnum->term(false) == NULL) {
482
 
            _CLTHROWA(CL_ERR_Runtime,"no terms in field "); //todo: make rich error + field);
483
 
          }
484
 
          do {
485
 
            Term* term = termEnum->term(false);
486
 
            if (term->field() != field) 
487
 
                                break;
488
 
            Comparable* termval = comparator->getComparable (term->text());
489
 
            termDocs->seek (termEnum);
490
 
            while (termDocs->next()) {
491
 
              retArray[termDocs->doc()] = termval;
492
 
            }
493
 
          } while (termEnum->next());
494
 
        } _CLFINALLY (
495
 
          termDocs->close();
496
 
          _CLDELETE(termDocs);
497
 
          termEnum->close();
498
 
          _CLDELETE(termEnum);
499
 
        );
500
 
      }
501
 
 
502
 
          FieldCacheAuto* fa = _CLNEW FieldCacheAuto(retLen,FieldCacheAuto::COMPARABLE_ARRAY);
503
 
          fa->comparableArray = retArray;
504
 
          fa->ownContents=true;
505
 
     store (reader, field, SortField::CUSTOM, fa);
506
 
         CLStringIntern::unintern(field);
507
 
     return fa;
508
 
    }
509
 
        CLStringIntern::unintern(field);
510
 
    return ret;
511
 
  }
512
 
 
513
 
 
514
 
    FieldCacheImpl::fieldcacheCacheReaderType::fieldcacheCacheReaderType(){
515
 
                setDeleteKey(false);
516
 
                setDeleteValue(false);
517
 
        }
518
 
        FieldCacheImpl::fieldcacheCacheReaderType::~fieldcacheCacheReaderType(){
519
 
                iterator itr = begin();
520
 
                while ( itr != end() ){
521
 
                        FileEntry* f = itr->first;
522
 
                        if ( f->getType() != SortField::AUTO )
523
 
                                _CLDELETE( itr->second );
524
 
                        _CLDELETE( f );
525
 
                        ++itr;
526
 
                }
527
 
                clear();
528
 
        }
529
 
CL_NS_END