start working on types for ezc library (types branch): Ezc::FunInfo<> renamed to Ezc::Env<>

This commit is contained in:
Tomasz Sowa 2021-09-08 15:34:40 +02:00
parent e682e057ad
commit 0fff26bf2f
3 changed files with 12 additions and 12 deletions

View File

@ -45,7 +45,7 @@
#include "convert/text.h"
#ifdef MORM_HAS_EZC_LIBRARY
#include "funinfo.h"
#include "env.h"
#endif

View File

@ -51,7 +51,7 @@
#include "wrapper.h"
#ifdef MORM_HAS_EZC_LIBRARY
#include "funinfo.h"
#include "env.h"
#endif
@ -82,14 +82,14 @@
#ifdef MORM_HAS_EZC_LIBRARY
#define MORM_MODEL_MEMBER_FIELD_EZC(ClassName) \
template<typename FunInfoStreamType> \
void field(const wchar_t * field_name, void (ClassName::*method)(Ezc::FunInfo<FunInfoStreamType> &), const morm::FT & field_type = morm::FT::default_type) \
void field(const wchar_t * field_name, void (ClassName::*method)(Ezc::Env<FunInfoStreamType> &), const morm::FT & field_type = morm::FT::default_type) \
{ \
field(field_name, field_name, method, field_type); \
} \
template<typename FunInfoStreamType> \
void field(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (ClassName::*method)(Ezc::FunInfo<FunInfoStreamType> &), 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::Env<FunInfoStreamType> &), const morm::FT & field_type = morm::FT::default_type) \
{ \
typedef void (Model::*ModelMember)(Ezc::FunInfo<FunInfoStreamType> &); \
typedef void (Model::*ModelMember)(Ezc::Env<FunInfoStreamType> &); \
ModelMember model_member = static_cast<ModelMember>(method); \
field_member_ezc(db_field_name, flat_field_name, model_member, field_type); \
} \
@ -263,7 +263,7 @@ public:
#ifdef MORM_HAS_EZC_LIBRARY
template<typename FunInfoStreamType>
bool get_raw_value(const wchar_t * db_field_name, const wchar_t * flat_field_name, ModelData * model_data,
Ezc::FunInfo<FunInfoStreamType> & fun_info, pt::Stream & stream, bool clear_stream = true)
Ezc::Env<FunInfoStreamType> & fun_info, pt::Stream & stream, bool clear_stream = true)
{
if( clear_stream )
{
@ -286,7 +286,7 @@ public:
try
{
fields();
fun_info.res = model_env->ezc_fun_result;
//fun_info.res = model_env->ezc_fun_result;
}
catch(...)
{
@ -907,7 +907,7 @@ protected:
#ifdef MORM_HAS_EZC_LIBRARY
template<typename FunInfoStreamType>
void field_member_ezc(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (Model::*method)(Ezc::FunInfo<FunInfoStreamType> &), const FT & field_type)
void field_member_ezc(const wchar_t * db_field_name, const wchar_t * flat_field_name, void (Model::*method)(Ezc::Env<FunInfoStreamType> &), const FT & field_type)
{
if( model_connector && model_env && model_env->ezc_fun_info && model_env->ezc_fun_info_typeinfo && model_env->model )
{
@ -930,16 +930,16 @@ protected:
template<typename FunInfoStreamType>
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<FunInfoStreamType> &), 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::Env<FunInfoStreamType> &), 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<FunInfoStreamType>) == *model_env->ezc_fun_info_typeinfo )
if( typeid(Ezc::Env<FunInfoStreamType>) == *model_env->ezc_fun_info_typeinfo )
{
Ezc::FunInfo<FunInfoStreamType> * ezc_fun_info = reinterpret_cast<Ezc::FunInfo<FunInfoStreamType>*>(model_env->ezc_fun_info);
Ezc::Env<FunInfoStreamType> * ezc_fun_info = reinterpret_cast<Ezc::Env<FunInfoStreamType>*>(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
}

View File

@ -44,7 +44,7 @@
#ifdef MORM_HAS_EZC_LIBRARY
#include "funinfo.h"
#include "env.h"
#endif