From 82e0c072eddf018cd3fda613be526fa5d778b31f Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Tue, 17 Jan 2017 20:56:58 +0000 Subject: [PATCH] use a tempalte here --- .../src/shared/core/DbBindableLong.h | 56 ++----------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h index f4dc519c..2e72b2c1 100755 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableLong.h @@ -29,14 +29,10 @@ namespace DB { void setValue(const long int rhs); BindableLong &operator=(const long int rhs); - // following alternate getValue's are provided for convenience, particularly in - // the auto-generated code: - void getValue(unsigned int &buffer) const; - void getValue(uint32 &buffer) const; // for some reason, our compiler is convinced that uint32 != unsigned int - void getValue(long int &buffer) const; - void getValue(int &buffer) const; - void getValue(int8 &buffer) const; - void getValue(uint8 &buffer) const; + template + inline void getValue(T &buffer) const { + buffer = static_cast(getValue()); + } void *getBuffer(); @@ -48,48 +44,4 @@ namespace DB { } -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(unsigned int &buffer) const -{ - buffer=static_cast(getValue()); -} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(uint32 &buffer) const -{ - buffer=static_cast(getValue()); -} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(long int &buffer) const -{ - buffer=getValue(); -} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(int &buffer) const -{ - buffer=getValue(); -} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(int8 &buffer) const -{ - buffer=static_cast(getValue()); -} - -// ---------------------------------------------------------------------- - -inline void DB::BindableLong::getValue(uint8 &buffer) const -{ - buffer=static_cast(getValue()); -} - -// ====================================================================== - #endif