From af242dfba62849e6fae675e5a944f5250a25705b Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 5 Dec 2024 17:48:50 +0100 Subject: [PATCH] WIP: use pt::Stream instead of a template argument --- src/model.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/model.h b/src/model.h index d71a8bc..d8b9fbc 100644 --- a/src/model.h +++ b/src/model.h @@ -81,15 +81,13 @@ #ifdef MORM_HAS_EZC_LIBRARY #define MORM_MODEL_MEMBER_FIELD_EZC(ClassName) \ - template \ - void field(const wchar_t * field_name, void (ClassName::*method)(Ezc::FunInfo &), const morm::FT & field_type = morm::FT::default_type) \ + void field(const wchar_t * field_name, void (ClassName::*method)(Ezc::FunInfo &), const morm::FT & field_type = morm::FT::default_type) \ { \ field(field_name, field_name, method, field_type); \ } \ - template \ - void field(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (ClassName::*method)(Ezc::FunInfo &), const morm::FT & field_type = morm::FT::default_type) \ + void field(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (ClassName::*method)(Ezc::FunInfo &), const morm::FT & field_type = morm::FT::default_type) \ { \ - typedef void (Model::*ModelMember)(Ezc::FunInfo &); \ + typedef void (Model::*ModelMember)(Ezc::FunInfo &); \ ModelMember model_member = static_cast(method); \ field_member_ezc(db_field_name, flat_field_name, model_member, field_type); \ } \ @@ -268,9 +266,9 @@ public: #ifdef MORM_HAS_EZC_LIBRARY - template + bool get_raw_value(const wchar_t * db_field_name, const wchar_t * flat_field_name, ModelData * model_data, - Ezc::FunInfo & fun_info, pt::Stream & stream, bool clear_stream = true) + Ezc::FunInfo & fun_info, pt::Stream & stream, bool clear_stream = true) { if( clear_stream ) { @@ -304,6 +302,7 @@ public: model_env = nullptr; return model_env_local.was_field_found; } + #endif @@ -938,8 +937,8 @@ protected: #ifdef MORM_HAS_EZC_LIBRARY - template - void field_member_ezc(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (Model::*method)(Ezc::FunInfo &), const FT & field_type) + + void field_member_ezc(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (Model::*method)(Ezc::FunInfo &), const FT & field_type) { if( model_connector && model_env && model_env->ezc_fun_info && model_env->ezc_fun_info_typeinfo && model_env->model ) { @@ -961,17 +960,16 @@ protected: } - template - void field_member_ezc_put_field_value_to_stream(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (Model::*method)(Ezc::FunInfo &), const FT & field_type) + void field_member_ezc_put_field_value_to_stream(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (Model::*method)(Ezc::FunInfo &), const FT & field_type) { if( (is_empty_field(model_env->db_field_name) || is_the_same_field(db_field_name, model_env->db_field_name)) && (is_empty_field(model_env->flat_field_name) || is_the_same_field(flat_field_name, model_env->flat_field_name)) ) { model_env->was_field_found = true; - if( typeid(Ezc::FunInfo) == *model_env->ezc_fun_info_typeinfo ) + if( typeid(Ezc::FunInfo) == *model_env->ezc_fun_info_typeinfo ) { - Ezc::FunInfo * ezc_fun_info = reinterpret_cast*>(model_env->ezc_fun_info); + Ezc::FunInfo * ezc_fun_info = reinterpret_cast(model_env->ezc_fun_info); (model_env->model->*method)(*ezc_fun_info); model_env->ezc_fun_result = ezc_fun_info->res; // ezc_fun_info->res is overwritten in get_raw_value() after fields() method call so we have to remember it in model_env }