X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Flib%2Fgscphftaaux%2Fhfta_udaf.cc;h=aa44d24adb8281c1194141713e117ea969e40556;hb=804ea15b01566ac0de58781ca61870b4824d0e02;hp=fb0f1d573657e8ef87082936808b982df6d4aefb;hpb=c9783d8ea8b85d810483559e50dbf2297109e349;p=com%2Fgs-lite.git diff --git a/src/lib/gscphftaaux/hfta_udaf.cc b/src/lib/gscphftaaux/hfta_udaf.cc index fb0f1d5..aa44d24 100644 --- a/src/lib/gscphftaaux/hfta_udaf.cc +++ b/src/lib/gscphftaaux/hfta_udaf.cc @@ -272,6 +272,75 @@ gs_float_t extr_avg_fcn(vstring *v){ ///////////////////////////////////////////////////////// // FIRST aggregate +// hfta only + +void FIRST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { + *scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX +} +void FIRST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { } +void FIRST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) { + if (*scratch == UINT_MAX) + *scratch = val; +} +void FIRST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) { + *res = *scratch; +} +void FIRST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { } + +void FIRST_HFTA_AGGR_INIT_(gs_uint64_t* scratch) { + *scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX +} +void FIRST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { } +void FIRST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) { + if (*scratch == UINT_MAX) + *scratch = val; +} +void FIRST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) { + *res = *scratch; +} +void FIRST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { } + + + +void FIRST_ULL_HFTA_AGGR_INIT_(gs_uint64_t* scratch) { + *scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX +} + +void FIRST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { } + +void FIRST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) { + if (*scratch == UINT_MAX) + *scratch = val; +} + +void FIRST_ULL_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) { + *res = *scratch; +} + +void FIRST_ULL_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { } + + +void FIRST_STR_HFTA_AGGR_INIT_(vstring* scratch) { + scratch->offset= 0; +} + +void FIRST_STR_HFTA_AGGR_REINIT_(vstring* scratch) { } + +void FIRST_STR_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val) { + if (!scratch->offset) { + scratch->length = val->length; + scratch->offset = val->offset; + scratch->reserved = SHALLOW_COPY; + } +} + +void FIRST_STR_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch) { + *res = *scratch; +} + +void FIRST_STR_HFTA_AGGR_DESTROY_(vstring* scratch) { } + +// hfta/lfta split void FIRST_hfta_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { *scratch = UINT_MAX; // we will encode uninitialized value of UINT_MAX @@ -328,9 +397,70 @@ void FIRST_STR_hfta_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch) { void FIRST_STR_hfta_HFTA_AGGR_DESTROY_(vstring* scratch) { } + ///////////////////////////////////////////////////////// // LAST aggregate +// hfta only + +void LAST_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { } +void LAST_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { } +void LAST_HFTA_AGGR_UPDATE_(gs_uint32_t* scratch, gs_uint32_t val) { + *scratch = val; +} +void LAST_HFTA_AGGR_OUTPUT_(gs_uint32_t* res, gs_uint32_t* scratch) { + *res = *scratch; +} +void LAST_HFTA_AGGR_DESTROY_(gs_uint32_t* scratch) { } + + +void LAST_HFTA_AGGR_INIT_(gs_uint64_t* scratch) { } +void LAST_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { } +void LAST_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) { + *scratch = val; +} +void LAST_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) { + *res = *scratch; +} +void LAST_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { } + + + +void LAST_ULLHFTA_AGGR_INIT_(gs_uint64_t* scratch) { } + +void LAST_ULL_HFTA_AGGR_REINIT_(gs_uint64_t* scratch) { } + +void LAST_ULL_HFTA_AGGR_UPDATE_(gs_uint64_t* scratch, gs_uint64_t val) { + *scratch = val; +} + +void LAST_ULL_HFTA_AGGR_OUTPUT_(gs_uint64_t* res, gs_uint64_t* scratch) { + *res = *scratch; +} + +void LAST_ULL_HFTA_AGGR_DESTROY_(gs_uint64_t* scratch) { } + + +void LAST_STR_HFTA_AGGR_INIT_(vstring* scratch) { + scratch->offset= 0; +} + +void LAST_STR_HFTA_AGGR_REINIT_(vstring* scratch) { } + +void LAST_STR_HFTA_AGGR_UPDATE_(vstring* scratch, vstring* val) { + scratch->length = val->length; + scratch->offset = val->offset; + scratch->reserved = SHALLOW_COPY; +} + +void LAST_STR_HFTA_AGGR_OUTPUT_(vstring* res, vstring* scratch) { + *res = *scratch; +} + +void LAST_STR_HFTA_AGGR_DESTROY_(vstring* scratch) { } + +// hfta/lfta split + void LAST_hfta_HFTA_AGGR_INIT_(gs_uint32_t* scratch) { } void LAST_hfta_HFTA_AGGR_REINIT_(gs_uint32_t* scratch) { }