@@ -352,7 +352,7 @@ namespace internal {
352
352
DLL_WARNINGS_PUSH
353
353
354
354
class PUBLIC_API CollectionAdd
355
- : public virtual Executable<Result>
355
+ : public virtual Executable<Result, CollectionAdd >
356
356
, public internal::CollectionAddInterface<CollectionAdd&>
357
357
{
358
358
@@ -435,16 +435,16 @@ namespace internal {
435
435
interface.
436
436
*/
437
437
438
- template <class Res , bool limit_with_offset>
438
+ template <class Res , class Op , bool limit_with_offset>
439
439
class CollectionSort
440
- : public Limit<Res, limit_with_offset>
440
+ : public Limit<Res, Op, limit_with_offset>
441
441
{
442
442
protected:
443
443
444
444
typedef internal::Sort_impl Impl;
445
445
446
- using Limit<Res, limit_with_offset>::check_if_valid;
447
- using Limit<Res, limit_with_offset>::m_impl;
446
+ using Limit<Res, Op, limit_with_offset>::check_if_valid;
447
+ using Limit<Res, Op, limit_with_offset>::m_impl;
448
448
449
449
Impl* get_impl ()
450
450
{
@@ -454,13 +454,13 @@ namespace internal {
454
454
455
455
public:
456
456
457
- Limit<Res, limit_with_offset>& sort (const string& ord_spec)
457
+ Limit<Res, Op, limit_with_offset>& sort (const string& ord_spec)
458
458
{
459
459
get_impl ()->add_sort (ord_spec);
460
460
return *this ;
461
461
}
462
462
463
- Limit<Res, limit_with_offset>& sort (const char * ord_spec)
463
+ Limit<Res, Op, limit_with_offset>& sort (const char * ord_spec)
464
464
{
465
465
get_impl ()->add_sort (ord_spec);
466
466
return *this ;
@@ -474,7 +474,7 @@ namespace internal {
474
474
*/
475
475
476
476
template <typename Ord>
477
- Limit<Res, limit_with_offset>& sort (Ord ord)
477
+ Limit<Res, Op, limit_with_offset>& sort (Ord ord)
478
478
{
479
479
for (auto el : ord)
480
480
{
@@ -491,7 +491,7 @@ namespace internal {
491
491
*/
492
492
493
493
template <typename Ord, typename ...Type>
494
- Limit<Res, limit_with_offset>& sort (Ord ord, const Type...rest)
494
+ Limit<Res, Op, limit_with_offset>& sort (Ord ord, const Type...rest)
495
495
{
496
496
get_impl ()->add_sort (ord);
497
497
return sort (rest...);
@@ -509,12 +509,18 @@ namespace internal {
509
509
Class defining .having() clause.
510
510
*/
511
511
512
+ template <class Op >
512
513
class CollectionHaving
513
- : public internal::CollectionSort<DocResult, true >
514
+ : public internal::CollectionSort<DocResult, Op, true >
514
515
{
515
516
516
517
typedef internal::Having_impl Impl;
517
- typedef internal::CollectionSort<DocResult, true > CollectionSort;
518
+ typedef internal::CollectionSort<DocResult, Op, true > CollectionSort;
519
+
520
+ protected:
521
+
522
+ using internal::CollectionSort<DocResult, Op, true >::check_if_valid;
523
+ using internal::CollectionSort<DocResult, Op, true >::m_impl;
518
524
519
525
Impl* get_impl ()
520
526
{
@@ -546,12 +552,18 @@ namespace internal {
546
552
Class defining .groupBy() clause.
547
553
*/
548
554
555
+ template <class Op >
549
556
class CollectionGroupBy
550
- : public internal::CollectionHaving
557
+ : public internal::CollectionHaving<Op>
551
558
{
552
559
553
560
typedef internal::Group_by_impl Impl;
554
- typedef internal::CollectionHaving CollectionHaving;
561
+ typedef internal::CollectionHaving<Op> CollectionHaving;
562
+
563
+ protected:
564
+
565
+ using internal::CollectionHaving<Op>::check_if_valid;
566
+ using internal::CollectionHaving<Op>::m_impl;
555
567
556
568
Impl* get_impl ()
557
569
{
@@ -622,7 +634,7 @@ namespace internal {
622
634
*/
623
635
624
636
class PUBLIC_API CollectionRemove
625
- : public internal::CollectionSort<Result,false >
637
+ : public internal::CollectionSort<Result, CollectionRemove, false >
626
638
{
627
639
public:
628
640
@@ -721,15 +733,18 @@ namespace internal {
721
733
DLL_WARNINGS_PUSH
722
734
723
735
class PUBLIC_API CollectionFind
724
- : public internal::CollectionGroupBy
736
+ : public internal::CollectionGroupBy<CollectionFind>
725
737
{
726
738
727
739
DLL_WARNINGS_POP
728
740
729
741
protected:
730
742
731
743
typedef internal::Proj_impl Impl;
732
- typedef internal::CollectionGroupBy CollectionGroupBy;
744
+ typedef internal::CollectionGroupBy<CollectionFind> CollectionGroupBy;
745
+
746
+ using internal::CollectionGroupBy<CollectionFind>::get_impl;
747
+ using internal::CollectionGroupBy<CollectionFind>::m_impl;
733
748
734
749
Impl* get_impl ()
735
750
{
@@ -758,7 +773,7 @@ DIAGNOSTIC_PUSH
758
773
DISABLE_WARNING (4100 )
759
774
#endif
760
775
761
- CollectionFind (CollectionFind &other) : Executable<DocResult>(other) {}
776
+ CollectionFind (CollectionFind &other) : Executable<DocResult,CollectionFind >(other) {}
762
777
CollectionFind (CollectionFind &&other) : CollectionFind(other) {}
763
778
764
779
DIAGNOSTIC_POP
@@ -908,6 +923,7 @@ namespace internal {
908
923
by the user.
909
924
*/
910
925
926
+
911
927
struct CollectionModify_impl : public Sort_impl
912
928
{
913
929
enum Operation
@@ -937,7 +953,7 @@ namespace internal {
937
953
*/
938
954
939
955
class PUBLIC_API CollectionModify
940
- : public internal::CollectionSort<Result,false >
956
+ : public internal::CollectionSort<Result, CollectionModify, false >
941
957
{
942
958
private:
943
959
@@ -971,7 +987,7 @@ DIAGNOSTIC_PUSH
971
987
DISABLE_WARNING (4100 )
972
988
#endif
973
989
974
- CollectionModify (CollectionModify &other) : Executable<Result>(other) {}
990
+ CollectionModify (CollectionModify &other) : Executable<Result,CollectionModify >(other) {}
975
991
CollectionModify (CollectionModify &&other) : CollectionModify(other) {}
976
992
977
993
DIAGNOSTIC_POP
0 commit comments