SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
KeyComparator.h
Go to the documentation of this file.
1 /*
2  * SWC-DB© Copyright since 2019 Alex Kashirin <kashirin.alex@gmail.com>
3  * License details at <https://github.com/kashirin-alex/swc-db/#license>
4  */
5 
6 
7 #ifndef swcdb_db_Cells_KeyComparator_h
8 #define swcdb_db_Cells_KeyComparator_h
9 
10 #include "swcdb/core/Compat.h"
11 #include "swcdb/core/Comparators.h"
12 #include "swcdb/db/Types/KeySeq.h"
13 #include "swcdb/db/Cells/CellKey.h"
15 
16 
17 
18 namespace SWC { namespace DB {
19 
20 
22 namespace KeySeq {
23 
24 
25 extern
27 condition(const Types::KeySeq seq,
28  const uint8_t *p1, uint32_t p1_len,
29  const uint8_t *p2, uint32_t p2_len)
30  noexcept SWC_ATTRIBS((SWC_ATTRIB_O3));
31 
32 template<Types::KeySeq T_seq>
33 extern
35 condition(const uint8_t *p1, uint32_t p1_len,
36  const uint8_t *p2, uint32_t p2_len)
37  noexcept SWC_ATTRIBS((SWC_ATTRIB_O3));
38 
39 
40 extern
41 bool
43  const uint8_t *p1, uint32_t p1_len,
44  const uint8_t *p2, uint32_t p2_len)
45  noexcept SWC_ATTRIBS((SWC_ATTRIB_O3));
46 
47 template<Types::KeySeq T_seq>
48 extern
49 bool
51  const uint8_t *p1, uint32_t p1_len,
52  const uint8_t *p2, uint32_t p2_len)
53  noexcept SWC_ATTRIBS((SWC_ATTRIB_O3));
54 
55 
56 extern
58 compare(const Types::KeySeq seq,
59  const Cell::Key& key, const Cell::Key& other)
60  SWC_ATTRIBS((SWC_ATTRIB_O3));
61 
62 template<Types::KeySeq T_seq>
63 extern
65 compare(const Cell::Key& key, const Cell::Key& other)
66  SWC_ATTRIBS((SWC_ATTRIB_O3));
67 
68 
69 extern
71 compare_upto(const Types::KeySeq seq,
72  const Cell::Key& key, const Cell::Key& other, uint24_t max)
73  SWC_ATTRIBS((SWC_ATTRIB_O3));
74 extern
76 compare_opt_lexic(const Cell::Key& opt_empty, const Cell::Key& other,
77  uint24_t max, bool empty_eq)
78  SWC_ATTRIBS((SWC_ATTRIB_O3));
79 
80 extern
82 compare_opt_volume(const Cell::Key& opt_empty, const Cell::Key& other,
83  uint24_t max, bool empty_eq)
84  SWC_ATTRIBS((SWC_ATTRIB_O3));
85 extern
87 compare_opt_fc_lexic(const Cell::Key& opt_empty, const Cell::Key& other,
88  uint24_t max, bool empty_eq)
89  SWC_ATTRIBS((SWC_ATTRIB_O3));
90 
91 extern
93 compare_opt_fc_volume(const Cell::Key& opt_empty, const Cell::Key& other,
94  uint24_t max, bool empty_eq)
95  SWC_ATTRIBS((SWC_ATTRIB_O3));
96 
97 template<Types::KeySeq T_seq>
98 extern
100 compare_opt(const Cell::Key& opt_empty, const Cell::Key& other,
101  uint24_t max, bool empty_eq)
102  SWC_ATTRIBS((SWC_ATTRIB_O3));
103 
104 
105 extern
106 bool
107 compare(const Types::KeySeq seq,
108  const Cell::Key& key, const Cell::Key& other,
109  Condition::Comp break_if, uint24_t max = 0, bool empty_ok=false)
110  SWC_ATTRIBS((SWC_ATTRIB_O3));
111 
112 template<Types::KeySeq T_seq>
113 extern
114 bool
115 compare(const Cell::Key& key, const Cell::Key& other,
116  Condition::Comp break_if, uint24_t max, bool empty_ok)
117  SWC_ATTRIBS((SWC_ATTRIB_O3));
118 
119 
120 extern
121 bool
122 compare(const Types::KeySeq seq,
123  const Cell::Key& key, const Cell::KeyVec& other,
124  Condition::Comp break_if, uint32_t max = 0, bool empty_ok=false)
125  SWC_ATTRIBS((SWC_ATTRIB_O3));
126 
127 template<Types::KeySeq T_seq>
128 extern
129 bool
130 compare(const Cell::Key& key, const Cell::KeyVec& other,
131  Condition::Comp break_if, uint32_t max, bool empty_ok)
132  SWC_ATTRIBS((SWC_ATTRIB_O3));
133 
134 
135 extern
136 bool
137 align(const Types::KeySeq seq, const Cell::Key& key,
138  Cell::KeyVec& start, Cell::KeyVec& finish)
139  SWC_ATTRIBS((SWC_ATTRIB_O3));
140 
141 template<Types::KeySeq T_seq>
142 extern
143 bool
144 align(const Cell::Key& key, Cell::KeyVec& start, Cell::KeyVec& finish)
145  SWC_ATTRIBS((SWC_ATTRIB_O3));
146 
147 
148 extern
149 bool
150 align(const Types::KeySeq seq, Cell::KeyVec& key,
151  const Cell::KeyVec& other, Condition::Comp comp)
152  SWC_ATTRIBS((SWC_ATTRIB_O3));
153 
154 template<Types::KeySeq T_seq>
155 extern
156 bool
157 align(Cell::KeyVec& key, const Cell::KeyVec& other, Condition::Comp comp)
158  SWC_ATTRIBS((SWC_ATTRIB_O3));
159 
161 
162 
163 
165 template<>
167 Condition::Comp
168 condition<Types::KeySeq::LEXIC>(const uint8_t *p1, uint32_t p1_len,
169  const uint8_t *p2, uint32_t p2_len) noexcept {
170  return Condition::condition_lexic(p1, p1_len, p2, p2_len);
171 }
172 
173 template<>
176 condition<Types::KeySeq::VOLUME>(const uint8_t *p1, uint32_t p1_len,
177  const uint8_t *p2, uint32_t p2_len) noexcept {
178  return Condition::condition_volume(p1, p1_len, p2, p2_len);
179 }
180 
181 extern SWC_CAN_INLINE
184  const uint8_t *p1, uint32_t p1_len,
185  const uint8_t *p2, uint32_t p2_len) noexcept {
186  switch(seq) {
187 
188  case Types::KeySeq::LEXIC:
189  case Types::KeySeq::FC_LEXIC:
190  return condition<Types::KeySeq::LEXIC>(p1, p1_len, p2, p2_len);
191 
192  case Types::KeySeq::VOLUME:
194  return condition<Types::KeySeq::VOLUME>(p1, p1_len, p2, p2_len);
195 
196  default:
197  return Condition::NONE;
198  }
199 }
201 
202 
203 
205 template<>
207 bool
208 is_matching<Types::KeySeq::LEXIC>(Condition::Comp comp,
209  const uint8_t *p1, uint32_t p1_len,
210  const uint8_t *p2, uint32_t p2_len) noexcept {
211  return Condition::is_matching_lexic(comp, p1, p1_len, p2, p2_len);
212 }
213 
214 template<>
216 bool
217 is_matching<Types::KeySeq::VOLUME>(Condition::Comp comp,
218  const uint8_t *p1, uint32_t p1_len,
219  const uint8_t *p2, uint32_t p2_len) noexcept {
220  return Condition::is_matching_volume(comp, p1, p1_len, p2, p2_len);
221 }
222 
223 extern SWC_CAN_INLINE
224 bool
226  const uint8_t *p1, uint32_t p1_len,
227  const uint8_t *p2, uint32_t p2_len) noexcept {
228  switch(seq) {
229 
230  case Types::KeySeq::LEXIC:
231  case Types::KeySeq::FC_LEXIC:
232  return is_matching<Types::KeySeq::LEXIC>(comp, p1, p1_len, p2, p2_len);
233 
234  case Types::KeySeq::VOLUME:
236  return is_matching<Types::KeySeq::VOLUME>(comp, p1, p1_len, p2, p2_len);
237 
238  default:
239  return false;
240  }
241 }
243 
244 
245 
247 template<Types::KeySeq T_seq>
248 extern SWC_CAN_INLINE
250 compare(const Cell::Key& key, const Cell::Key& other) {
251  if(uint24_t min = key.count < other.count ? key.count : other.count) {
252  const uint8_t* p1 = key.data;
253  const uint8_t* p2 = other.data;
254  uint24_t sz1;
255  uint24_t sz2;
256  for(Condition::Comp comp; min; --min, p1 += sz1, p2 += sz2) {
257  sz1 = Serialization::decode_vi24(&p1);
258  sz2 = Serialization::decode_vi24(&p2);
259  if((comp = condition<T_seq>(p1, sz1, p2, sz2)) != Condition::EQ)
260  return comp;
261  }
262  }
263  return key.count == other.count
264  ? Condition::EQ
265  : (key.count > other.count ? Condition::LT : Condition::GT);
266 }
267 
268 template<>
271 compare<Types::KeySeq::FC_LEXIC>(const Cell::Key& key,
272  const Cell::Key& other) {
273  return key.count < other.count
274  ? Condition::GT
275  : (key.count > other.count
276  ? Condition::LT
277  : compare<Types::KeySeq::LEXIC>(key, other) );
278 }
279 
280 template<>
283 compare<Types::KeySeq::FC_VOLUME>(const Cell::Key& key,
284  const Cell::Key& other) {
285  return key.count < other.count
286  ? Condition::GT
287  : (key.count > other.count
288  ? Condition::LT
289  : compare<Types::KeySeq::VOLUME>(key, other) );
290 }
291 
292 extern SWC_CAN_INLINE
294 compare(const Types::KeySeq seq, const Cell::Key& key,
295  const Cell::Key& other) {
296  switch(seq) {
297 
298  case Types::KeySeq::LEXIC:
299  return compare<Types::KeySeq::LEXIC>(key, other);
300 
301  case Types::KeySeq::VOLUME:
302  return compare<Types::KeySeq::VOLUME>(key, other);
303 
304  case Types::KeySeq::FC_LEXIC:
305  return compare<Types::KeySeq::FC_LEXIC>(key, other);
306 
308  return compare<Types::KeySeq::FC_VOLUME>(key, other);
309 
310  default:
311  return Condition::NONE;
312  }
313 }
315 
316 
317 
319 template<Types::KeySeq T_seq>
320 extern SWC_CAN_INLINE
322 compare_opt(const Cell::Key& opt_empty, const Cell::Key& other,
323  uint24_t max, bool empty_eq) {
324  if(uint24_t min = opt_empty.count < other.count
325  ? opt_empty.count : other.count) {
326  if(max && min > max)
327  min = max;
328  const uint8_t* p1 = opt_empty.data;
329  const uint8_t* p2 = other.data;
330  uint24_t sz1;
331  uint24_t sz2;
332  for(Condition::Comp comp; min; --min, p1 += sz1, p2 += sz2) {
333  sz2 = Serialization::decode_vi24(&p2);
334  if(!(sz1 = Serialization::decode_vi24(&p1)) && empty_eq)
335  return Condition::EQ;
336  if((comp = condition<T_seq>(p1, sz1, p2, sz2)) != Condition::EQ)
337  return comp;
338  }
339  }
340  return opt_empty.count != other.count &&
341  (!max || max > opt_empty.count || max > other.count)
342  ? opt_empty.count > other.count ? Condition::LT : Condition::GT
343  : Condition::EQ;
344 }
345 
346 template<>
349 compare_opt<Types::KeySeq::FC_LEXIC>(
350  const Cell::Key& opt_empty, const Cell::Key& other,
351  uint24_t max, bool empty_eq) {
352  if(!max || max > opt_empty.count || max > other.count) {
353  if(opt_empty.count < other.count)
354  return Condition::GT;
355  if(opt_empty.count > other.count)
356  return Condition::LT;
357  }
358  return compare_opt<Types::KeySeq::LEXIC>(
359  opt_empty, other, max, empty_eq);
360 }
361 
362 template<>
365 compare_opt<Types::KeySeq::FC_VOLUME>(
366  const Cell::Key& opt_empty, const Cell::Key& other,
367  uint24_t max, bool empty_eq) {
368  if(!max || max > opt_empty.count || max > other.count) {
369  if(opt_empty.count < other.count)
370  return Condition::GT;
371  if(opt_empty.count > other.count)
372  return Condition::LT;
373  }
374  return compare_opt<Types::KeySeq::VOLUME>(
375  opt_empty, other, max, empty_eq);
376 }
377 
378 
379 extern SWC_CAN_INLINE
381 compare_opt_lexic(const Cell::Key& opt_empty, const Cell::Key& other,
382  uint24_t max, bool empty_eq) {
383  return compare_opt<Types::KeySeq::LEXIC>(
384  opt_empty, other, max, empty_eq);
385 }
386 
387 extern SWC_CAN_INLINE
389 compare_opt_volume(const Cell::Key& opt_empty, const Cell::Key& other,
390  uint24_t max, bool empty_eq) {
391  return compare_opt<Types::KeySeq::VOLUME>(
392  opt_empty, other, max, empty_eq);
393 }
394 
395 extern SWC_CAN_INLINE
397 compare_opt_fc_lexic(const Cell::Key& opt_empty, const Cell::Key& other,
398  uint24_t max, bool empty_eq) {
399  return compare_opt<Types::KeySeq::FC_LEXIC>(
400  opt_empty, other, max, empty_eq);
401 }
402 
403 extern SWC_CAN_INLINE
405 compare_opt_fc_volume(const Cell::Key& opt_empty, const Cell::Key& other,
406  uint24_t max, bool empty_eq) {
407  return compare_opt<Types::KeySeq::FC_VOLUME>(
408  opt_empty, other, max, empty_eq);
409 }
411 
412 
413 
415 extern SWC_CAN_INLINE
418  const Cell::Key& key, const Cell::Key& other,
419  uint24_t max) {
420  switch(seq) {
421  case Types::KeySeq::LEXIC:
422  return compare_opt<Types::KeySeq::LEXIC>(
423  key, other, max, false);
424 
425  case Types::KeySeq::VOLUME:
426  return compare_opt<Types::KeySeq::VOLUME>(
427  key, other, max, false);
428 
429  case Types::KeySeq::FC_LEXIC:
430  return compare_opt<Types::KeySeq::FC_LEXIC>(
431  key, other, max, false);
432 
434  return compare_opt<Types::KeySeq::FC_VOLUME>(
435  key, other, max, false);
436 
437  default:
438  return Condition::NONE;
439  }
440 }
442 
443 
444 
446 template<Types::KeySeq T_seq>
447 extern SWC_CAN_INLINE
448 bool
449 compare(const Cell::Key& key, const Cell::Key& other,
450  Condition::Comp break_if, uint24_t max, bool empty_ok) {
451  const uint8_t* p1 = key.data;
452  const uint8_t* p2 = other.data;
453  uint24_t sz1;
454  uint24_t sz2;
455  if(!max)
456  max = key.count > other.count ? key.count : other.count;
457  for(uint24_t c = 0; c<max; ++c, p1 += sz1, p2 += sz2) {
458 
459  if(c == key.count || c == other.count)
460  return key.count > other.count
461  ? break_if != Condition::LT
462  : break_if != Condition::GT;
463 
464  sz2 = Serialization::decode_vi24(&p2);
465  if(!(sz1 = Serialization::decode_vi24(&p1)) && empty_ok)
466  continue;
467 
468  if(condition<T_seq>(p1, sz1, p2, sz2) == break_if)
469  return false;
470  }
471  return true;
472 }
473 
474 template<>
476 bool
477 compare<Types::KeySeq::FC_LEXIC>(
478  const Cell::Key& key, const Cell::Key& other,
479  Condition::Comp break_if, uint24_t max, bool empty_ok) {
480  if(!max || max > key.count || max > other.count ) {
481  if(key.count < other.count)
482  return break_if != Condition::GT;
483  if(key.count > other.count)
484  return break_if != Condition::LT;
485  }
486  return compare<Types::KeySeq::LEXIC>(key, other, break_if, max, empty_ok);
487 }
488 
489 template<>
491 bool
492 compare<Types::KeySeq::FC_VOLUME>(
493  const Cell::Key& key, const Cell::Key& other,
494  Condition::Comp break_if, uint24_t max, bool empty_ok) {
495  if(!max || max > key.count || max > other.count ) {
496  if(key.count < other.count)
497  return break_if != Condition::GT;
498  if(key.count > other.count)
499  return break_if != Condition::LT;
500  }
501  return compare<Types::KeySeq::VOLUME>(key, other, break_if, max, empty_ok);
502 }
503 
504 extern SWC_CAN_INLINE
505 bool
507  const Cell::Key& key, const Cell::Key& other,
508  Condition::Comp break_if, uint24_t max, bool empty_ok) {
509  switch(seq) {
510 
511  case Types::KeySeq::LEXIC:
512  return compare<Types::KeySeq::LEXIC>(
513  key, other, break_if, max, empty_ok);
514 
515  case Types::KeySeq::VOLUME:
516  return compare<Types::KeySeq::VOLUME>(
517  key, other, break_if, max, empty_ok);
518 
519  case Types::KeySeq::FC_LEXIC:
520  return compare<Types::KeySeq::FC_LEXIC>(
521  key, other, break_if, max, empty_ok);
522 
524  return compare<Types::KeySeq::FC_VOLUME>(
525  key, other, break_if, max, empty_ok);
526 
527  default:
528  return false;
529  }
530 }
532 
533 
534 
536 template<Types::KeySeq T_seq>
537 extern SWC_CAN_INLINE
538 bool
539 compare(const Cell::Key& key, const Cell::KeyVec& other,
540  Condition::Comp break_if, uint32_t max, bool empty_ok) {
541  const uint8_t* ptr = key.data;
542  uint24_t len;
543  if(!max)
544  max = key.count > other.size() ? uint32_t(key.count) : other.size();
545  for(uint32_t c = 0; c<max; ++c, ptr += len) {
546 
547  if(c == key.count || c == other.size())
548  return key.count > other.size()
549  ? break_if != Condition::LT
550  : break_if != Condition::GT;
551 
552  if(!(len = Serialization::decode_vi24(&ptr)) && empty_ok)
553  continue;
554 
555  auto& r = other[c];
556  if(condition<T_seq>(ptr, len, r.data(), r.length())
557  == break_if)
558  return false;
559  }
560  return true;
561 }
562 
563 template<>
565 bool
566 compare<Types::KeySeq::FC_LEXIC>(
567  const Cell::Key& key, const Cell::KeyVec& other,
568  Condition::Comp break_if, uint32_t max, bool empty_ok) {
569  if(!max || max > key.count || max > other.size() ) {
570  if(key.count < other.size())
571  return break_if != Condition::GT;
572  if(key.count > other.size())
573  return break_if != Condition::LT;
574  }
575  return compare<Types::KeySeq::LEXIC>(key, other, break_if, max, empty_ok);
576 }
577 
578 template<>
580 bool
581 compare<Types::KeySeq::FC_VOLUME>(
582  const Cell::Key& key, const Cell::KeyVec& other,
583  Condition::Comp break_if, uint32_t max, bool empty_ok) {
584  if(!max || max > key.count || max > other.size() ) {
585  if(key.count < other.size())
586  return break_if != Condition::GT;
587  if(key.count > other.size())
588  return break_if != Condition::LT;
589  }
590  return compare<Types::KeySeq::VOLUME>(key, other, break_if, max, empty_ok);
591 }
592 
593 extern SWC_CAN_INLINE
594 bool
596  const Cell::Key& key, const Cell::KeyVec& other,
597  Condition::Comp break_if, uint32_t max, bool empty_ok) {
598  switch(seq) {
599 
600  case Types::KeySeq::LEXIC:
601  return compare<Types::KeySeq::LEXIC>(
602  key, other, break_if, max, empty_ok);
603 
604  case Types::KeySeq::VOLUME:
605  return compare<Types::KeySeq::VOLUME>(
606  key, other, break_if, max, empty_ok);
607 
608  case Types::KeySeq::FC_LEXIC:
609  return compare<Types::KeySeq::FC_LEXIC>(
610  key, other, break_if, max, empty_ok);
611 
613  return compare<Types::KeySeq::FC_VOLUME>(
614  key, other, break_if, max, empty_ok);
615 
616  default:
617  return false;
618  }
619 }
621 
622 
623 
625 template<Types::KeySeq T_seq>
626 extern SWC_CAN_INLINE
627 bool
628 align(const Cell::Key& key, Cell::KeyVec& start, Cell::KeyVec& finish) {
629  const uint8_t* ptr = key.data;
630  uint24_t len;
631  bool chg = false;
632  auto it_min = start.begin();
633  auto it_max = finish.begin();
634  for(uint24_t c = 0; c < key.count; ++c, ptr += len) {
635  len = Serialization::decode_vi24(&ptr);
636 
637  if(it_min == start.cend()) {
638  start.add(ptr, len);
639  chg = true;
640  it_min = start.end();
641  } else {
642  if(condition<T_seq>(it_min->data(), it_min->size(),
643  ptr, len) == Condition::LT) {
644  it_min->assign(ptr, len);
645  chg = true;
646  }
647  ++it_min;
648  }
649 
650  if(it_max == finish.cend()) {
651  finish.add(ptr, len);
652  chg = true;
653  it_max = finish.end();
654  } else {
655  if(condition<T_seq>(it_max->data(), it_max->size(),
656  ptr, len) == Condition::GT) {
657  it_max->assign(ptr, len);
658  chg = true;
659  }
660  ++it_max;
661  }
662  }
663  return chg;
664 }
665 
666 extern SWC_CAN_INLINE
667 bool
668 align(const Types::KeySeq seq, const Cell::Key& key,
669  Cell::KeyVec& start, Cell::KeyVec& finish) {
670  switch(seq) {
671 
672  case Types::KeySeq::LEXIC:
673  case Types::KeySeq::FC_LEXIC:
674  return align<Types::KeySeq::LEXIC>(key, start, finish);
675 
676  case Types::KeySeq::VOLUME:
678  return align<Types::KeySeq::VOLUME>(key, start, finish);
679 
680  default:
681  return false;
682  }
683 }
685 
686 
687 
689 template<Types::KeySeq T_seq>
690 extern SWC_CAN_INLINE
691 bool
692 align(Cell::KeyVec& key, const Cell::KeyVec& other, Condition::Comp comp) {
693  if(other.empty())
694  return false;
695  if(key.empty()) {
696  key.assign(other.cbegin(), other.cend());
697  return true;
698  }
699  bool small;
700  uint24_t min = (small=key.size() < other.size())? key.size() : other.size();
701  bool chg = false;
702  auto it2 = other.cbegin();
703  for(auto it1 = key.begin(); min; --min, ++it1, ++it2) {
704  if(condition<T_seq>(it1->data(), it1->size(),
705  it2->data(), it2->size())
706  == comp) {
707  it1->assign(*it2);
708  chg = true;
709  }
710  }
711  if(small) {
712  do key.add(*it2);
713  while(++it2 != other.cend());
714  return true;
715  }
716  return chg;
717 }
718 
719 extern SWC_CAN_INLINE
720 bool
722  const Cell::KeyVec& other, Condition::Comp comp) {
723  switch(seq) {
724 
725  case Types::KeySeq::LEXIC:
726  case Types::KeySeq::FC_LEXIC:
727  return align<Types::KeySeq::LEXIC>(key, other, comp);
728 
729  case Types::KeySeq::VOLUME:
731  return align<Types::KeySeq::VOLUME>(key, other, comp);
732 
733  default:
734  return false;
735  }
736 }
738 
739 
740 
741 }}}
742 
743 
744 
745 #endif // swcdb_db_Cells_KeyComparator_h
SWC::DB::KeySeq::is_matching
bool is_matching(const Types::KeySeq seq, Condition::Comp comp, const uint8_t *p1, uint32_t p1_len, const uint8_t *p2, uint32_t p2_len) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:225
SWC_ATTRIBS
#define SWC_ATTRIBS(attrs)
Definition: Compat.h:53
SWC::DB::KeySeq::compare_opt_volume
Condition::Comp compare_opt_volume(const Cell::Key &opt_empty, const Cell::Key &other, uint24_t max, bool empty_eq) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:389
SWC::DB::KeySeq::compare_opt
Condition::Comp compare_opt(const Cell::Key &opt_empty, const Cell::Key &other, uint24_t max, bool empty_eq) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:322
SWC::DB::KeySeq::align
bool align(const Types::KeySeq seq, const Cell::Key &key, Cell::KeyVec &start, Cell::KeyVec &finish) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:668
CellKeyVec.h
SWC::DB::Cell::KeyVec
Definition: CellKeyVec.h:21
SWC::DB::KeySeq::condition
Condition::Comp condition(const Types::KeySeq seq, const uint8_t *p1, uint32_t p1_len, const uint8_t *p2, uint32_t p2_len) noexcept SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:183
SWC::Condition::GT
@ GT
Definition: Comparators.h:30
KeySeq.h
SWC::Condition::condition_volume
SWC_CAN_INLINE Comp condition_volume(const uint8_t *p1, uint32_t p1_len, const uint8_t *p2, uint32_t p2_len) noexcept
Definition: Comparators.h:132
SWC::Condition::LT
@ LT
Definition: Comparators.h:34
SWC::DB::KeySeq::compare_opt_fc_lexic
Condition::Comp compare_opt_fc_lexic(const Cell::Key &opt_empty, const Cell::Key &other, uint24_t max, bool empty_eq) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:397
SWC::DB::Cell::Key
Definition: CellKey.h:24
SWC::DB::KeySeq::compare_opt_lexic
Condition::Comp compare_opt_lexic(const Cell::Key &opt_empty, const Cell::Key &other, uint24_t max, bool empty_eq) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:381
SWC::DB::Cell::Key::data
uint8_t * data
Definition: CellKey.h:257
SWC::DB::Types::KeySeq
KeySeq
Definition: KeySeq.h:13
SWC::DB::Types::KeySeq::UNKNOWN
@ UNKNOWN
SWC::Condition::is_matching_volume
SWC_CAN_INLINE bool is_matching_volume(uint8_t comp, const uint8_t *p1, uint32_t p1_len, const uint8_t *p2, uint32_t p2_len)
Definition: Comparators.h:361
SWC::Condition::Comp
Comp
Definition: Comparators.h:27
SWC::Core::Vector::empty
constexpr SWC_CAN_INLINE bool empty() const noexcept
Definition: Vector.h:168
SWC_CAN_INLINE
#define SWC_CAN_INLINE
Definition: Compat.h:102
SWC::Core::Vector::end
constexpr SWC_CAN_INLINE iterator end() noexcept
Definition: Vector.h:227
SWC
The SWC-DB C++ namespace 'SWC'.
Definition: main.cc:12
SWC::DB::KeySeq::compare_upto
Condition::Comp compare_upto(const Types::KeySeq seq, const Cell::Key &key, const Cell::Key &other, uint24_t max) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:417
SWC::DB::Cell::KeyVec::size
constexpr SWC_CAN_INLINE size_type size() const noexcept
Definition: Vector.h:189
SWC::Serialization::decode_vi24
constexpr SWC_CAN_INLINE uint24_t decode_vi24(const uint8_t **bufp, size_t *remainp)
Definition: Serialization.h:217
Compat.h
SWC::Condition::EQ
@ EQ
Definition: Comparators.h:32
Comparators.h
SWC::Condition::NONE
@ NONE
Definition: Comparators.h:28
SWC::Condition::condition_lexic
SWC_CAN_INLINE Comp condition_lexic(const uint8_t *p1, uint32_t p1_len, const uint8_t *p2, uint32_t p2_len) noexcept
Definition: Comparators.h:119
SWC::Condition::is_matching_lexic
SWC_CAN_INLINE bool is_matching_lexic(uint8_t comp, const uint8_t *p1, uint32_t p1_len, const uint8_t *p2, uint32_t p2_len)
Definition: Comparators.h:308
SWC::DB::KeySeq::compare_opt_fc_volume
Condition::Comp compare_opt_fc_volume(const Cell::Key &opt_empty, const Cell::Key &other, uint24_t max, bool empty_eq) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:405
SWC::DB::Cell::Key::count
uint24_t count
Definition: CellKey.h:255
SWC::uint24_t
Core::uint24_t uint24_t
Definition: BitFieldInt.h:401
SWC::Core::Vector::cend
constexpr SWC_CAN_INLINE const_iterator cend() const noexcept
Definition: Vector.h:232
SWC::Core::Vector::assign
SWC_CAN_INLINE void assign(IteratorT first, IteratorT last)
Definition: Vector.h:452
SWC::DB::Cell::KeyVec::add
SWC_CAN_INLINE void add(const Fraction &fraction)
Definition: CellKeyVec.h:62
SWC::Core::Vector::cbegin
constexpr SWC_CAN_INLINE const_iterator cbegin() const noexcept
Definition: Vector.h:216
CellKey.h
SWC::DB::KeySeq::compare
Condition::Comp compare(const Types::KeySeq seq, const Cell::Key &key, const Cell::Key &other) SWC_ATTRIBS((SWC_ATTRIB_O3))
Definition: KeyComparator.h:294
SWC::Core::Vector::begin
constexpr SWC_CAN_INLINE iterator begin() noexcept
Definition: Vector.h:211