Changeset: d983ee8193f6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d983ee8193f6
Modified Files:
        monetdb5/modules/mosaic/mosaic_delta.c
        monetdb5/modules/mosaic/mosaic_dict.c
        monetdb5/modules/mosaic/mosaic_dict256.c
        monetdb5/modules/mosaic/mosaic_frame.c
        monetdb5/modules/mosaic/mosaic_linear.c
        monetdb5/modules/mosaic/mosaic_prefix.c
        monetdb5/modules/mosaic/mosaic_raw.c
        monetdb5/modules/mosaic/mosaic_runlength.c
        monetdb5/modules/mosaic/mosaic_select_template.h
        monetdb5/modules/mosaic/mosaic_utility.h
Branch: mosaic
Log Message:

Bit of macro-refactoring.


diffs (truncated from 721 to 300 lines):

diff --git a/monetdb5/modules/mosaic/mosaic_delta.c 
b/monetdb5/modules/mosaic/mosaic_delta.c
--- a/monetdb5/modules/mosaic/mosaic_delta.c
+++ b/monetdb5/modules/mosaic/mosaic_delta.c
@@ -63,27 +63,29 @@ MOSlayout_delta(MOStask* task, BAT *btec
                return;
 }
 
+#define NAME delta
+#define METHOD_SPECIFIC_INCLUDE MAKE_TEMPLATE_INCLUDE_FILE(NAME)
+
 #define COMPRESSION_DEFINITION
 #define TPE bte
-#include "mosaic_delta_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE sht
-#include "mosaic_delta_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE int
-#include "mosaic_delta_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE lng
-#include "mosaic_delta_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #ifdef HAVE_HGE
 #define TPE hge
-#include "mosaic_delta_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #endif
 #undef COMPRESSION_DEFINITION
 
-#define NAME delta
 #define TPE bte
 #include "mosaic_select_template.h"
 #undef TPE
@@ -101,7 +103,6 @@ MOSlayout_delta(MOStask* task, BAT *btec
 #include "mosaic_select_template.h"
 #undef TPE
 #endif
-#undef NAME
 
 #define projection_loop_delta(TPE, CANDITER_NEXT)\
 {\
@@ -123,7 +124,6 @@ MOSlayout_delta(MOStask* task, BAT *btec
        }\
 }
 
-#define NAME delta
 #define TPE bte
 #include "mosaic_projection_template.h"
 #undef TPE
@@ -141,7 +141,6 @@ MOSlayout_delta(MOStask* task, BAT *btec
 #include "mosaic_projection_template.h"
 #undef TPE
 #endif
-#undef NAME
 
 #define outer_loop_delta(HAS_NIL, NIL_MATCHES, TPE, LEFT_CI_NEXT, 
RIGHT_CI_NEXT) \
 {\
@@ -172,3 +171,6 @@ MOSjoin_COUI_DEF(delta, lng)
 #ifdef HAVE_HGE
 MOSjoin_COUI_DEF(delta, hge)
 #endif
+
+#undef METHOD_SPECIFIC_INCLUDE
+#undef NAME
diff --git a/monetdb5/modules/mosaic/mosaic_dict.c 
b/monetdb5/modules/mosaic/mosaic_dict.c
--- a/monetdb5/modules/mosaic/mosaic_dict.c
+++ b/monetdb5/modules/mosaic/mosaic_dict.c
@@ -88,76 +88,64 @@ MOSlayout_dict(MOStask* task, BAT *btech
 }
 
 #define NAME dict
+#define METHOD_SPECIFIC_INCLUDE "mosaic_dictionary_templates.h"
 #define PREPARATION_DEFINITION
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef PREPARATION_DEFINITION
-#undef NAME
 
-#define NAME dict
 #define COMPRESSION_DEFINITION
 #define TPE bte
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE sht
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE int
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE lng
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE flt
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE dbl
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #ifdef HAVE_HGE
 #define TPE hge
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #endif
-#undef NAME
 #undef COMPRESSION_DEFINITION
 
-#define NAME dict
 #define TPE bte
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE sht
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE int
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE lng
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE flt
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE dbl
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #ifdef HAVE_HGE
 #define TPE hge
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #endif
-#undef NAME
 
 #define projection_loop_dict(TPE, CI_NEXT) \
     projection_loop_dictionary(dict, TPE, CI_NEXT)
 
-#define NAME dict
 #define TPE bte
 #include "mosaic_projection_template.h"
 #undef TPE
@@ -181,7 +169,6 @@ MOSlayout_dict(MOStask* task, BAT *btech
 #include "mosaic_projection_template.h"
 #undef TPE
 #endif
-#undef NAME
 
 #define outer_loop_dict(HAS_NIL, NIL_MATCHES, TPE, LEFT_CI_NEXT, 
RIGHT_CI_NEXT) \
     outer_loop_dictionary(HAS_NIL, NIL_MATCHES, dict, TPE, LEFT_CI_NEXT, 
RIGHT_CI_NEXT)
@@ -195,3 +182,6 @@ MOSjoin_COUI_DEF(dict, dbl)
 #ifdef HAVE_HGE
 MOSjoin_COUI_DEF(dict, hge)
 #endif
+
+#undef METHOD_SPECIFIC_INCLUDE
+#undef NAME
diff --git a/monetdb5/modules/mosaic/mosaic_dict256.c 
b/monetdb5/modules/mosaic/mosaic_dict256.c
--- a/monetdb5/modules/mosaic/mosaic_dict256.c
+++ b/monetdb5/modules/mosaic/mosaic_dict256.c
@@ -107,80 +107,66 @@ MOSlayout_dict256(MOStask* task, BAT *bt
                BUNappend(bproperties, "", false) != GDK_SUCCEED)
                return;
 }
-#define NAME dict256
-#define PREPARATION_DEFINITION
-#define MOS_CUT_OFF_SIZE CAPPEDDICT
-#include "mosaic_dictionary_templates.h"
-#undef MOS_CUT_OFF_SIZE
-#undef PREPARATION_DEFINITION
-#undef NAME
 
 #define NAME dict256
+#define METHOD_SPECIFIC_INCLUDE "mosaic_dictionary_templates.h"
+#define PREPARATION_DEFINITION
+#include METHOD_SPECIFIC_INCLUDE
+#undef PREPARATION_DEFINITION
+
 #define COMPRESSION_DEFINITION
 #define TPE bte
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE sht
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE int
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE lng
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE flt
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #define TPE dbl
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #ifdef HAVE_HGE
 #define TPE hge
-#include "mosaic_dictionary_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
 #endif
-#undef NAME
 #undef COMPRESSION_DEFINITION
 
-// TODO: instead of NAME make METHOD_SPECIFIC_SCANLOOP_INCLUDE leading. this 
will make the include mechanism a bit cleaner
-#define NAME dict256
 #define TPE bte
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE sht
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE int
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE lng
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE flt
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #define TPE dbl
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #ifdef HAVE_HGE
 #define TPE hge
-#define METHOD_SPECIFIC_SCANLOOP_INCLUDE "mosaic_dictionary_templates.h"
 #include "mosaic_select_template.h"
 #undef TPE
 #endif
-#undef NAME
 
 #define projection_loop_dict256(TPE, CI_NEXT) \
     projection_loop_dictionary(dict256, TPE, CI_NEXT)
 
-#define NAME dict256
 #define TPE bte
 #include "mosaic_projection_template.h"
 #undef TPE
@@ -204,7 +190,6 @@ MOSlayout_dict256(MOStask* task, BAT *bt
 #include "mosaic_projection_template.h"
 #undef TPE
 #endif
-#undef NAME
 
 #define outer_loop_dict256(HAS_NIL, NIL_MATCHES, TPE, LEFT_CI_NEXT, 
RIGHT_CI_NEXT) \
     outer_loop_dictionary(HAS_NIL, NIL_MATCHES, dict256, TPE, LEFT_CI_NEXT, 
RIGHT_CI_NEXT)
@@ -218,3 +203,6 @@ MOSjoin_COUI_DEF(dict256, dbl)
 #ifdef HAVE_HGE
 MOSjoin_COUI_DEF(dict256, hge)
 #endif
+
+#undef METHOD_SPECIFIC_INCLUDE
+#undef NAME
diff --git a/monetdb5/modules/mosaic/mosaic_frame.c 
b/monetdb5/modules/mosaic/mosaic_frame.c
--- a/monetdb5/modules/mosaic/mosaic_frame.c
+++ b/monetdb5/modules/mosaic/mosaic_frame.c
@@ -62,27 +62,29 @@ MOSlayout_frame(MOStask* task, BAT *btec
                return;
 }
 
+#define NAME frame
+#define METHOD_SPECIFIC_INCLUDE MAKE_TEMPLATE_INCLUDE_FILE(NAME)
+
 #define COMPRESSION_DEFINITION
 #define TPE bte
-#include "mosaic_frame_templates.h"
+#include METHOD_SPECIFIC_INCLUDE
 #undef TPE
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to