ADi-FontEngine  1.0
PDF Optimized FontEngine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FontEngineDBank.h
Go to the documentation of this file.
1 // FontEngine/FontEngineDBank.h
2 //
3 // Copyright 2012 - Andreas Dippe
4 //
5 // This file is part of ADi-FontEngine, 2012
6 //-----------------------------------------------------------------------------
7 
8 #ifndef _FONTENGINEDBANK_H_
9 #define _FONTENGINEDBANK_H_
10 
12 
13 #include <vector>
14 #include <deque>
15 #include <set>
16 
17 namespace FontEngine
18 {
19 
20  //-----------------------------------------------------------------------------
21  //-----------------------------------------------------------------------------
22  //
23  //-----------------------------------------------------------------------------
24  //! The insert action enum, to set data bank behavior if a item will be inserted, modified or imported
26  {
27  edbaInsertAlways //!< always insert the item, allow duplicates of same item
28  , edbaOverwriteInsert //!< overwrite an existing item avoid duplicates
29  , edbaInsertNever //!< keep existing item discard new item
30  , edbaThrowIfExist //!< throw an exception if such item already exist
31  };
32  //-----------------------------------------------------------------------------
33  //-----------------------------------------------------------------------------
34  //
35  //-----------------------------------------------------------------------------
36  /*! \brief The default comparison function template to sort items in data bank class
37  \param T the data bank item type
38  \param S the data bank selector type
39  */
40  template< typename T, typename S >
41  struct TDBComp
42  {
43  typedef T value_type;
44  typedef S selector_type;
45  //-----------------------------------------------------------------------------
46  /*! \brief callback comparison function to sort iItem into the data bank class
47  \param v1 the first data bank item
48  \param v2 the second data bank item
49  \param sel the comparison selector
50  \return true if v1 < v2, depends from sel
51  */
52  bool operator()( const value_type & v1, const value_type & v2, selector_type sel) const
53  {
54  (void)v1; (void)v2; (void)sel; // to avoid compiler warnings
55  return true;
56  }
57  //-----------------------------------------------------------------------------
58  /*! \brief callback function called by data bank class before insert an item. The default insert items always.
59  \param v the data bank item to insert
60  \param sel the comparison selector
61  \return one of the EDBCompActionRes values to set insert action
62  */
64  {
65  (void)v; (void)sel; // to avoid compiler warnings
66  return edbaInsertAlways;
67  }
68  };
69  //-----------------------------------------------------------------------------
70  //-----------------------------------------------------------------------------
71  /*! \class TDBank
72  \brief The data bank template and example to demonstrate how the TDBank template works:
73  \include ADiFEDBankDemo.cpp
74  */
75  //-----------------------------------------------------------------------------
76  /*! \brief flexible data bank class template
77  \param T the data bank item type
78  \param S the data bank selector type
79  \param N the number of selectors used to define number of primary key sets
80  \param P the comparison function object, see struct TDBComp
81  */
82  template< typename T, typename S, size_t N, typename P = TDBComp< T, S > >
83  struct TDBank
84  {
85  private:
86  typedef T value_type;
87  typedef S selector_type;
88  typedef P comp_type;
89 // typedef std::vector< value_type > TDataVec;
90  typedef std::deque< value_type > TDataVec;
91  typedef typename TDataVec::size_type TDataVecST;
92  //-----------------------------------------------------------------------------
93  //! define number of primary key sets as enum value
94  enum ESetConst
95  {
96  numSets = N
97  };
98  //-----------------------------------------------------------------------------
99  //-----------------------------------------------------------------------------
100  /*! primary key struct used as TDataSet value in two cases
101  first: as index into data bank storage
102  second: as pointer to temp item in search functions
103  */
104  struct TMSetKey
105  {
106  /*! \brief ctor to create from index into data bank storage
107  \param vidx index into data bank storage
108  */
109  explicit TMSetKey( TDataVecST vidx)
110  : _ptr( false)
111  , _vidx( vidx)
112  {}
113  //-----------------------------------------------------------------------------
114  /*! \brief ctor to create from pointer to temp item
115  \param val temp item pointer
116  */
117  explicit TMSetKey( const value_type* val)
118  : _ptr( true)
119  , _val( val)
120  {}
121  //-----------------------------------------------------------------------------
122  /*! \brief to compare two objects of struct TMSetKey
123  \param msk instance to compare
124  \return true if this is equal to msk
125  */
126  bool operator==( const TMSetKey & msk) const
127  {
128  FontEngine_Assert( !_ptr && !msk._ptr);
129  return (!_ptr && !msk._ptr) ? (_vidx == msk._vidx) : false;
130  }
131  //-----------------------------------------------------------------------------
132  bool _ptr; //!< if true _val is valid else the _vidx member keeps a valid index
133  union {
134  TDataVecST _vidx; //!< the ndex into data bank storage if _ptr is false
135  const value_type* _val; //!< the pointer to temp item if _ptr is true
136  };
137  };
138  //-----------------------------------------------------------------------------
139  //-----------------------------------------------------------------------------
140  /*! comparison function object used as TDataSet prediction class
141  */
142  struct TDBEval
143  {
144  /*! \brief default ctor to initialize
145  */
146  TDBEval()
147  : _db( NULL)
148  , _sel( static_cast<selector_type>( 0))
149  {}
150  //-----------------------------------------------------------------------------
151  /*! \brief ctor to use in TDataSet
152  \param db the data bank instance
153  \param sel the comparison selector for this TDBEval ionstance to compare
154  */
155  TDBEval( const TDBank & db, selector_type sel)
156  : _db( &db)
157  , _sel( sel)
158  {}
159  //-----------------------------------------------------------------------------
160  /*! \brief function operator to compare two TMSetKey instances
161  \param v1 the first TMSetKey item
162  \param v2 the second TMSetKey item
163  \return result of the call of the comparison function object from template argument in TDBank
164  */
165  bool operator()( const TMSetKey v1, const TMSetKey v2) const
166  {
167  FontEngine_Assert( (v1._ptr && (NULL != v1._val)) || (_db->_datavec.size() > v1._vidx));
168  FontEngine_Assert( (v2._ptr && (NULL != v2._val)) || (_db->_datavec.size() > v2._vidx));
169  return _db->_comp( v1._ptr ? *v1._val : _db->_datavec[v1._vidx], v2._ptr ? *v2._val : _db->_datavec[v2._vidx], _sel);
170  }
171  //-----------------------------------------------------------------------------
172  /*! \brief assignment operator
173  \param dbe the TDBEval to copy
174  \return this
175  */
176  TDBEval & operator=( const TDBEval & dbe)
177  {
178  _db = dbe._db;
179  _sel = dbe._sel;
180  return *this;
181  }
182  //-----------------------------------------------------------------------------
183  const TDBank* _db; //!< the underlying data bank instance must be a valid pointer
184  selector_type _sel; //!< the comparison selector used by this
185  };
186  //-----------------------------------------------------------------------------
187  //-----------------------------------------------------------------------------
188  typedef std::multiset<TMSetKey, TDBEval> TDataSet;
189  typedef typename TDataSet::iterator TDataSetIT;
190  typedef typename TDataSet::const_iterator TDataSetCIT;
191  typedef std::pair<TDataSetCIT, TDataSetCIT> TDataSetEqualRange;
192  typedef std::vector< TDataSet > TPredVec;
193  typedef typename TPredVec::size_type TPredVecST;
194  //-----------------------------------------------------------------------------
195  //-----------------------------------------------------------------------------
196  public:
197  /*! the iterator class
198  */
199  struct TIterator
200  {
201  /*! \brief ctor
202  \param datavec the data bank storage
203  \param cont the comparison set
204  \param it an iterator from cont
205  */
206  TIterator( const TDataVec & datavec, const TDataSet & cont, const TDataSetCIT & it)
207  : _datavec( &datavec)
208  , _cont( &cont)
209  , _it( it)
210  {}
211  //-----------------------------------------------------------------------------
212  /*! \brief assignment operator
213  \param it the TIterator to copy
214  \return const this
215  */
216  const TIterator & operator=( const TIterator & it)
217  {
218  FontEngine_Assert( (NULL != _cont) && (NULL != _datavec));
219  ThrowFontEngineException( _datavec == it._datavec, eDBEntryInvalid);
220  _it = it._it;
221  _cont = it._cont;
222  return *this;
223  }
224  //-----------------------------------------------------------------------------
225  /*! \brief unequal operator
226  \param it the TIterator to compare
227  \return const this
228  */
229  bool operator!=( const TIterator & it) const
230  {
231  FontEngine_Assert( (NULL != _cont) && (NULL != _datavec));
232  ThrowFontEngineException( (_cont == it._cont) && (_datavec == it._datavec), eDBEntryInvalid);
233  return _it != it._it;
234  }
235  //-----------------------------------------------------------------------------
236  /*! \brief equal operator
237  \param it the TIterator to compare
238  \return const this
239  */
240  bool operator==( const TIterator & it) const
241  {
242  FontEngine_Assert( (NULL != _cont) && (NULL != _datavec));
243  ThrowFontEngineException( (_cont == it._cont) && (_datavec == it._datavec), eDBEntryInvalid);
244  return _it == it._it;
245  }
246  //-----------------------------------------------------------------------------
247  /*! \brief reference operator, it must be sure that this point to an valid value
248  \return const reference of a value
249  */
250  const value_type & operator*() const
251  {
252  FontEngine_Assert( (NULL != _cont) && (NULL != _datavec));
253  ThrowFontEngineException( (_cont->end() != _it) && ((*_it)._ptr && (NULL != (*_it)._val)) || (_datavec->size() > (*_it)._vidx), eDBEntryInvalid);
254  return (*_it)._ptr ? *(*_it)._val : (*_datavec)[(*_it)._vidx];
255  }
256  //-----------------------------------------------------------------------------
257  /*! \brief prefix increment operator, it must be sure that this point to an valid value
258  \return const this
259  */
260  const TIterator & operator++() const
261  {
262  ++_it;
263  return *this;
264  }
265  //-----------------------------------------------------------------------------
266  /*! \brief prefix decrement operator, it must be sure that this point to an valid value
267  \return const this
268  */
269  const TIterator & operator--() const
270  {
271  --_it;
272  return *this;
273  }
274  //-----------------------------------------------------------------------------
275  /*! \brief get index to data base storage
276  \return index to data base storage
277  */
278  TDataVecST dindex() const
279  {
280  FontEngine_Assert( !(*_it)._ptr);
281  return (*_it)._vidx;
282  }
283  //-----------------------------------------------------------------------------
284  private:
285  const TDataVec* _datavec; //!< the data bank storage
286  const TDataSet* _cont; //!< the comparison set
287  mutable TDataSetCIT _it; //!< an iterator from _cont
288  };
289  //-----------------------------------------------------------------------------
290  typedef TIterator iterator;
291  typedef const TIterator const_iterator;
292  typedef TDataVec TDataImportVec;
293  typedef typename TDataVec::size_type TDataIndex;
294  //-----------------------------------------------------------------------------
295  public:
296  /*! \brief default ctor
297  */
299  {
300  _predvec.reserve( numSets);
301  for( TPredVecST i = 0; i < numSets; ++i)
302  _predvec.push_back( TDataSet( TDBEval( *this, static_cast<selector_type>( i))));
303  };
304  //-----------------------------------------------------------------------------
305  /*! \brief copy ctor
306  \param db data bank to copy
307  */
308  TDBank( const TDBank & db)
309  : _datavec( db._datavec)
310  {
311  _predvec.reserve( numSets);
312  FontEngine_Assert( numSets == db._predvec.size());
313  for( TPredVecST i = 0; i < numSets; ++i) {
314  _predvec.push_back( TDataSet( TDBEval( *this, static_cast<selector_type>( i))));
315  _predvec.back().insert( db._predvec[i].begin(), db._predvec[i].end());
316  }
317  }
318  //-----------------------------------------------------------------------------
319  /*! \brief assignment operator
320  \param db data bank to copy
321  \return this
322  */
323  TDBank & operator=( const TDBank & db)
324  {
325  _datavec = db._datavec;
326  FontEngine_Assert( _predvec.size() == db._predvec.size());
327  for( TPredVecST i = 0; i < numSets; ++i) {
328  _predvec[i].clear();
329  _predvec[i].insert( db._predvec[i].begin(), db._predvec[i].end());
330  }
331  return *this;
332  }
333  //-----------------------------------------------------------------------------
334  /*! \brief to compare two objects of struct TDBank
335  \param db instance to compare
336  \return true if this is equal to db
337  */
338  bool operator==( const TDBank & db) const
339  {
340  return (_datavec == db._datavec) && (_predvec == db._predvec);
341  }
342  //-----------------------------------------------------------------------------
343  /*! \brief index operator
344  \param didx index into data bank storage must be valid
345  \return reference to indexed value
346  */
347  const value_type & operator[]( TDataIndex didx) const
348  {
349  ThrowFontEngineException( didx < _datavec.size(), eDBIndexInvalid);
350  return _datavec[didx];
351  }
352  //-----------------------------------------------------------------------------
353  /*! \brief return the size state
354  \return true if the data bank is empty
355  */
356  bool empty() const
357  {
358  return _datavec.empty();
359  }
360  //-----------------------------------------------------------------------------
361  /*! \brief return the size of data bank storage
362  \return the data bank size
363  */
364  size_t size() const
365  {
366  return _datavec.size();
367  }
368  //-----------------------------------------------------------------------------
369  /*! \brief return the size of data bank storage with selector
370  \param sel the comparison selector to get size
371  \return the data bank size
372  */
373  size_t size( selector_type sel) const
374  {
375  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
376  return _predvec[static_cast<TPredVecST>( sel)].size();
377  }
378  //-----------------------------------------------------------------------------
379  /*! \brief reset data bank storage
380  */
381  void clear()
382  {
383 // _datavec.resize( 1);
384  _datavec.clear();
385  _predvec.clear();
386  _predvec.reserve( numSets);
387  for( TPredVecST i = 0; i < numSets; ++i)
388  _predvec.push_back( TDataSet( TDBEval( *this, static_cast<selector_type>( i))));
389  }
390  //-----------------------------------------------------------------------------
391  /*! \brief insert a new value item into data bank storage
392  this function will call the the comparison function object, see struct TDBComp
393  \param vt the new value item
394  */
395  void insert( const value_type & vt)
396  {
397  TDataVecST key( _datavec.size());
398 
399  _datavec.push_back( vt);
400  for( TPredVecST i = 0; i < numSets; ++i) {
401  EDBCompActionRes car( _comp( vt, static_cast<selector_type>( i)));
402 
403  switch( car) {
404  case edbaThrowIfExist:
405  case edbaOverwriteInsert: {
406  TDataSetCIT it( _predvec[i].find( TMSetKey( &vt)));
407 
408  if( _predvec[i].end() != it) {
410  _predvec[i].erase( it);
411  }
412  }
413  case edbaInsertAlways:
414  _predvec[i].insert( TMSetKey( key));
415  break;
416  case edbaInsertNever:
417  break;
418  }
419  }
420  }
421  //-----------------------------------------------------------------------------
422  /*! \brief get storage iterator from first item with selector
423  \param sel the comparison selector to get iterator
424  \return first iterator
425  */
426  iterator begin( selector_type sel) const
427  {
428  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
429  return TIterator( _datavec, _predvec[sel], _predvec[sel].begin());
430  }
431  //-----------------------------------------------------------------------------
432  /*! \brief get storage iterator from end with selector, this is the invalid iterator for this selector to compare with other iterators
433  \param sel the comparison selector to get end iterator
434  \return end iterator
435  */
436  iterator end( selector_type sel) const
437  {
438  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
439  return TIterator( _datavec, _predvec[sel], _predvec[sel].end());
440  }
441  //-----------------------------------------------------------------------------
442  /*! \brief get number of value items in same range as given value with selector
443  \param vt the search value item
444  \param sel the comparison selector
445  \return number of value items in same range as given value
446  */
447  size_t count( const value_type & vt, selector_type sel) const
448  {
449  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
450  return _predvec[sel].count( TMSetKey( &vt));
451  }
452  //-----------------------------------------------------------------------------
453  /*! \brief get storage first iterator in same range as given value with selector
454  \param vt the search value item
455  \param sel the comparison selector
456  \return storage first iterator from same range as given value with selector
457  */
458  iterator lower_bound( const value_type & vt, selector_type sel) const
459  {
460  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
461  return TIterator( _datavec, _predvec[sel], _predvec[sel].lower_bound( TMSetKey( &vt)));
462  }
463  //-----------------------------------------------------------------------------
464  /*! \brief get storage first iterator from outside same range as given value with selector
465  \param vt the search value item
466  \param sel the comparison selector
467  \return storage first iterator from outside same range as given value with selector
468  */
469  iterator upper_bound( const value_type & vt, selector_type sel) const
470  {
471  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
472  return TIterator( _datavec, _predvec[sel], _predvec[sel].upper_bound( TMSetKey( &vt)));
473  }
474  //-----------------------------------------------------------------------------
475  /*! \brief find storage first iterator from given value with selector
476  \param vt the search value item
477  \param sel the comparison selector
478  \return storage first iterator in same range as given value with selector
479  */
480  iterator find( const value_type & vt, selector_type sel) const
481  {
482  ThrowFontEngineException( static_cast<TPredVecST>( sel) < _predvec.size(), eWrongDBSelector);
483  return TIterator( _datavec, _predvec[sel], _predvec[sel].find( TMSetKey( &vt)));
484  }
485  //-----------------------------------------------------------------------------
486  /*! \brief earse value item from storage with iterator
487  \param it an valid iterator
488  \return the following iterator can be end
489  */
490  iterator erase( const iterator & it)
491  {
492  TDataVecST idx( it.dindex());
493  iterator ret( it);
494 
495  ++ret;
496  for( TPredVecST i = 0; i < numSets; ++i) {
497  for( TDataSetEqualRange itr = _predvec[i].equal_range( TMSetKey( idx)); itr.first != itr.second; ++itr.first) {
498  FontEngine_Assert( !(*(itr.first))._ptr);
499  if( idx == (*(itr.first))._vidx) {
500  _predvec[i].erase( itr.first);
501  break;
502  }
503  }
504  }
505  return ret;
506  }
507  //-----------------------------------------------------------------------------
508  /*! \brief modify existing value item with iterator
509  \param it an valid iterator
510  \param vt the new value to replace
511  */
512  void modify( const iterator & it, const value_type & vt)
513  {
514  TDataVecST idx( it.dindex());
515 
516  erase( it);
517  _datavec[idx] = vt;
518  for( TPredVecST i = 0; i < numSets; ++i) {
519  EDBCompActionRes car( _comp( vt, static_cast<selector_type>( i)));
520 
521  switch( car) {
522  case edbaThrowIfExist:
523  case edbaOverwriteInsert: {
524  TDataSetCIT dsit( _predvec[i].find( TMSetKey( &vt)));
525 
526  if( _predvec[i].end() != dsit) {
528  _predvec[i].erase( dsit);
529  }
530  }
531  case edbaInsertAlways:
532  _predvec[i].insert( TMSetKey( idx));
533  break;
534  case edbaInsertNever:
535  break;
536  }
537  }
538  }
539  //-----------------------------------------------------------------------------
540  /*! \brief swap all storage date between other data bank instance
541  \param db other data bank instance
542  */
543  void swap( TDBank & db)
544  {
545  _datavec.swap( db._datavec);
546  for( TPredVecST i = 0; i < numSets; ++i)
547  _predvec[i].swap( db._predvec[i]);
548  }
549  //-----------------------------------------------------------------------------
550  /*! \brief merge from other data bank storage into own instance with selector
551  \param db other data bank instance
552  \param sel the comparison selector
553  */
554  void merge( const TDBank & db, selector_type sel)
555  {
556  for( iterator it = db.begin( sel), eit = db.end( sel); it != eit; ++it) {
557  iterator checkit( find( *it, sel));
558 
559  if( end( sel) == checkit)
560  insert( *it);
561  }
562  }
563  //-----------------------------------------------------------------------------
564  /*! \brief import from value array into own instance
565  \param data the value array
566  */
567  void import( TDataImportVec & data)
568  {
569  for( TPredVecST i = 0; i < numSets; ++i)
570  _predvec[i].clear();
571  _datavec.swap( data);
572  for( TDataVecST i = 0; i < _datavec.size(); ++i) {
573  for( TPredVecST j = 0; j < numSets; ++j) {
574  EDBCompActionRes car( _comp( _datavec[i], static_cast<selector_type>( i)));
575 
576  switch( car) {
577  case edbaThrowIfExist:
578  case edbaOverwriteInsert: {
579  TDataSetCIT dsit( _predvec[j].find( TMSetKey( &_datavec[i])));
580 
581  if( _predvec[j].end() != dsit) {
583  _predvec[j].erase( dsit);
584  }
585  }
586  case edbaInsertAlways:
587  _predvec[j].insert( TMSetKey( &_datavec[i]));
588  break;
589  case edbaInsertNever:
590  break;
591  }
592  }
593  }
594  }
595  //-----------------------------------------------------------------------------
596  private:
597  TDataVec _datavec; //!< the data bank storage
598  TPredVec _predvec; //!< the data comparison set
599  const comp_type _comp; //!< the data comparison function object
600  };
601 
602 } // PostScript namespace
603 
604 #endif // _FONTENGINEDBANK_H_
605 //-----------------------------------------------------------------------------
606 /*!\history
607 ** ADi-2012-12-14: creation
608 ** ADi-2013-01-25: remove unused code
609 ** ADi-2013-04-17: TIterator::operator=(..) should not be const and can copy member _cont
610 ** ADi-2013-06-27: Solaris compiler dont like underscore in front of an template parameter
611 ** ADi-2013-11-18: correct doxygen comments
612 */
EDBCompActionRes operator()(const value_type &v, selector_type sel) const
callback function called by data bank class before insert an item. The default insert items always...
Definition: FontEngineDBank.h:63
const TIterator const_iterator
Definition: FontEngineDBank.h:291
bool operator()(const value_type &v1, const value_type &v2, selector_type sel) const
callback comparison function to sort iItem into the data bank class
Definition: FontEngineDBank.h:52
size_t size(selector_type sel) const
return the size of data bank storage with selector
Definition: FontEngineDBank.h:373
TDataVec::size_type TDataIndex
Definition: FontEngineDBank.h:293
TDBank & operator=(const TDBank &db)
assignment operator
Definition: FontEngineDBank.h:323
void modify(const iterator &it, const value_type &vt)
modify existing value item with iterator
Definition: FontEngineDBank.h:512
overwrite an existing item avoid duplicates
Definition: FontEngineDBank.h:28
EDBCompActionRes
The insert action enum, to set data bank behavior if a item will be inserted, modified or imported...
Definition: FontEngineDBank.h:25
bool operator!=(const TIterator &it) const
unequal operator
Definition: FontEngineDBank.h:229
TDBank()
default ctor
Definition: FontEngineDBank.h:298
TIterator(const TDataVec &datavec, const TDataSet &cont, const TDataSetCIT &it)
ctor
Definition: FontEngineDBank.h:206
iterator upper_bound(const value_type &vt, selector_type sel) const
get storage first iterator from outside same range as given value with selector
Definition: FontEngineDBank.h:469
TIterator iterator
Definition: FontEngineDBank.h:290
iterator erase(const iterator &it)
earse value item from storage with iterator
Definition: FontEngineDBank.h:490
bool operator==(const TDBank &db) const
to compare two objects of struct TDBank
Definition: FontEngineDBank.h:338
( 8) dbank direct index is invalid
Definition: FontEngineError.h:75
iterator lower_bound(const value_type &vt, selector_type sel) const
get storage first iterator in same range as given value with selector
Definition: FontEngineDBank.h:458
S selector_type
Definition: FontEngineDBank.h:44
( 6) dbank entry already exist
Definition: FontEngineError.h:73
TDataVecST dindex() const
get index to data base storage
Definition: FontEngineDBank.h:278
void swap(TDBank &db)
swap all storage date between other data bank instance
Definition: FontEngineDBank.h:543
throw an exception if such item already exist
Definition: FontEngineDBank.h:30
iterator find(const value_type &vt, selector_type sel) const
find storage first iterator from given value with selector
Definition: FontEngineDBank.h:480
void clear()
reset data bank storage
Definition: FontEngineDBank.h:381
( 5) wrong selector in dbank class
Definition: FontEngineError.h:72
const TIterator & operator++() const
prefix increment operator, it must be sure that this point to an valid value
Definition: FontEngineDBank.h:260
keep existing item discard new item
Definition: FontEngineDBank.h:29
TDataVec TDataImportVec
Definition: FontEngineDBank.h:292
always insert the item, allow duplicates of same item
Definition: FontEngineDBank.h:27
TDBank(const TDBank &db)
copy ctor
Definition: FontEngineDBank.h:308
void insert(const value_type &vt)
insert a new value item into data bank storage this function will call the the comparison function ob...
Definition: FontEngineDBank.h:395
Definition: FontEngineDBank.h:199
void FontEngine_Assert(bool expr)
function to check program process no excption raise
Definition: FontEngineError.h:200
The default comparison function template to sort items in data bank class.
Definition: FontEngineDBank.h:41
void ThrowFontEngineException(bool expr, EErrorCodes errcode, bool dbg_break=true)
function to raise FontEngine exception
Definition: FontEngineError.h:169
const value_type & operator[](TDataIndex didx) const
index operator
Definition: FontEngineDBank.h:347
T value_type
Definition: FontEngineDBank.h:43
void merge(const TDBank &db, selector_type sel)
merge from other data bank storage into own instance with selector
Definition: FontEngineDBank.h:554
bool operator==(const TIterator &it) const
equal operator
Definition: FontEngineDBank.h:240
iterator end(selector_type sel) const
get storage iterator from end with selector, this is the invalid iterator for this selector to compar...
Definition: FontEngineDBank.h:436
flexible data bank class template
Definition: FontEngineDBank.h:83
size_t count(const value_type &vt, selector_type sel) const
get number of value items in same range as given value with selector
Definition: FontEngineDBank.h:447
size_t size() const
return the size of data bank storage
Definition: FontEngineDBank.h:364
const TIterator & operator--() const
prefix decrement operator, it must be sure that this point to an valid value
Definition: FontEngineDBank.h:269
const TIterator & operator=(const TIterator &it)
assignment operator
Definition: FontEngineDBank.h:216
( 7) dbank entry or iterator is invalid
Definition: FontEngineError.h:74
iterator begin(selector_type sel) const
get storage iterator from first item with selector
Definition: FontEngineDBank.h:426
const value_type & operator*() const
reference operator, it must be sure that this point to an valid value
Definition: FontEngineDBank.h:250
bool empty() const
return the size state
Definition: FontEngineDBank.h:356
InsideFont and ADI-FontEngine : Andreas Dippe, © 2013
http://www.insidefont.de