Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

terimber_db_value_vector_impl Class Reference

abstract class to set conditions for lookup More...

#include <memdb.h>

Inheritance diagram for terimber_db_value_vector_impl:

terimber_db_value_vector

List of all members.

Public Member Functions

 terimber_db_value_vector_impl (size_t count)
 constructor
virtual ~terimber_db_value_vector_impl ()
 destructor
virtual size_t get_size () const
 gets vector size
virtual bool set_value_as_null (size_t index, dbtypes type)
 sets value as null
virtual bool set_value_as_bool (size_t index, bool val)
 sets value as a boolean
virtual bool set_value_as_char (size_t index, sb1_t val)
 sets value as a char
virtual bool set_value_as_byte (size_t index, ub1_t val)
 sets value as a byte
virtual bool set_value_as_short (size_t index, sb2_t val)
 sets value as a short
virtual bool set_value_as_word (size_t index, ub2_t val)
 sets value as an unsigned short
virtual bool set_value_as_long (size_t index, sb4_t val)
 sets value as a long
virtual bool set_value_as_dword (size_t index, ub4_t val)
 sets value as an unsigned long
virtual bool set_value_as_float (size_t index, float val)
 sets value as a float
virtual bool set_value_as_double (size_t index, double val)
 sets value as a double
virtual bool set_value_as_long64 (size_t index, sb8_t val)
 sets value as a signed int64
virtual bool set_value_as_dword64 (size_t index, ub8_t val)
 sets value as an unsigned int64
virtual bool set_value_as_guid (size_t index, const guid_t &val)
 sets value as a guid
virtual bool set_value_as_numeric (size_t index, const char *val, char delimeter)
 sets value as a numeric
virtual bool set_value_as_decimal (size_t index, const char *val, char delimeter)
 sets value as a decimal
virtual bool set_value_as_date (size_t index, ub4_t year, ub1_t month, ub1_t day, ub1_t hour, ub1_t minute, ub1_t second, ub2_t millisec)
 sets value as a date
virtual bool set_value_as_string (size_t index, const char *val, size_t len)
 sets value as a string for 0 terminated string len can be -1
virtual bool set_value_as_string_ptr (size_t index, const char *val)
 sets value as a string pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed. it is supposed to work only for input parameters, not for output or input/output ones
virtual bool set_value_as_wstring (size_t index, const wchar_t *val, size_t len)
 sets value as a wide string for 0 terminated string len can be -1
virtual bool set_value_as_wstring_ptr (size_t index, const wchar_t *val)
 sets value as a wide string pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed.
virtual bool set_value_as_binary (size_t index, const ub1_t *val, size_t len)
 sets value as a binary val points to the valid buffer of raw byte of "len" length
virtual bool set_value_as_binary_ptr (size_t index, const ub1_t *val)
 sets value as a binary pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed. the format of the buffer must be as follows first size_t bytes the length of the rest of buffer, which contains the raw byte data it is supposed to work only for input parameters, not for output or input/output ones
virtual bool get_value_is_null (size_t index) const
 checks if the value is null
virtual bool get_value_as_bool (size_t index) const
 gets the value as a boolean
virtual sb1_t get_value_as_char (size_t index) const
 gets the value as a char
virtual ub1_t get_value_as_byte (size_t index) const
 gets the value as a byte
virtual sb2_t get_value_as_short (size_t index) const
 gets the value as a short
virtual ub2_t get_value_as_word (size_t index) const
 gets the value as an unsigned short
virtual sb4_t get_value_as_long (size_t index) const
 gets the value as a long
virtual ub4_t get_value_as_dword (size_t index) const
 gets the value as an unsigned long
virtual float get_value_as_float (size_t index) const
 gets the value as a float
virtual double get_value_as_double (size_t index) const
 gets the value as a double
virtual sb8_t get_value_as_long64 (size_t index) const
 gets the value as a int32
virtual ub8_t get_value_as_dword64 (size_t index) const
 gets the value as an unsigned int32
virtual bool get_value_as_guid (size_t index, guid_t &val) const
 gets the value as a guid for higher performance we are using reference
virtual const char * get_value_as_numeric (size_t index, char delimeter) const
 gets the value as a numeric
virtual const char * get_value_as_decimal (size_t index, char delimeter) const
 gets the value as a deciaml
virtual bool get_value_as_date (size_t index, ub4_t &year, ub1_t &month, ub1_t &day, ub1_t &hour, ub1_t &minute, ub1_t &second, ub2_t &millisec, ub1_t &wday, ub2_t &yday) const
 gets the value as a date
virtual const char * get_value_as_string (size_t index) const
 gets the value as a string function returns the pointer to string
virtual const wchar_tget_value_as_wstring (size_t index) const
 gets the value as a wide string function returns the pointer to wide string
virtual const ub1_tget_value_as_binary (size_t index, size_t &len) const
 gets the value as a binary returns pointer to the raw bytes size of bytes is put to len
virtual const ub1_tget_value_as_binary_ptr (size_t index) const
 gets the value as a binary pointer for reusing only the format of buffer is as follows first size_t bytes the length of the rest of buffer, which contains the raw byte data

Public Attributes

byte_allocator _tmp_allocator
 temporary allocator
vector< binder_value
 vector of binders

Private Member Functions

terimber_xml_value get_value_as_value (size_t index, vt_types type) const
 converts one type to the other type


Detailed Description

abstract class to set conditions for lookup

Definition at line 53 of file memdb.h.


Constructor & Destructor Documentation

BEGIN_TERIMBER_NAMESPACE terimber_db_value_vector_impl::terimber_db_value_vector_impl ( size_t  count  ) 

constructor

Parameters:
count  vector size

Definition at line 43 of file memlookup.cpp.

References _value, and vector< T >::resize().

terimber_db_value_vector_impl::~terimber_db_value_vector_impl (  )  [virtual]

destructor

Definition at line 52 of file memlookup.cpp.


Member Function Documentation

size_t terimber_db_value_vector_impl::get_size (  )  const [virtual]

gets vector size

Implements terimber_db_value_vector.

Definition at line 57 of file memlookup.cpp.

References _value, and base_vector< T >::size().

Referenced by memlookup::construct().

bool terimber_db_value_vector_impl::set_value_as_null ( size_t  index,
dbtypes  type 
) [virtual]

sets value as null

sets condition value

Parameters:
index  index
type  db type

Implements terimber_db_value_vector.

Definition at line 64 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_bool ( size_t  index,
bool  val 
) [virtual]

sets value as a boolean

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 73 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_char ( size_t  index,
sb1_t  val 
) [virtual]

sets value as a char

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 82 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_byte ( size_t  index,
ub1_t  val 
) [virtual]

sets value as a byte

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 91 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_short ( size_t  index,
sb2_t  val 
) [virtual]

sets value as a short

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 100 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_word ( size_t  index,
ub2_t  val 
) [virtual]

sets value as an unsigned short

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 109 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_long ( size_t  index,
sb4_t  val 
) [virtual]

sets value as a long

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 118 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_dword ( size_t  index,
ub4_t  val 
) [virtual]

sets value as an unsigned long

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 127 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_float ( size_t  index,
float  val 
) [virtual]

sets value as a float

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 136 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_double ( size_t  index,
double  val 
) [virtual]

sets value as a double

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 145 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_long64 ( size_t  index,
sb8_t  val 
) [virtual]

sets value as a signed int64

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 154 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_dword64 ( size_t  index,
ub8_t  val 
) [virtual]

sets value as an unsigned int64

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 163 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_guid ( size_t  index,
const guid_t val 
) [virtual]

sets value as a guid

Parameters:
index  index
val  value

Implements terimber_db_value_vector.

Definition at line 172 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_numeric ( size_t  index,
const char *  val,
char  delimeter 
) [virtual]

sets value as a numeric

Parameters:
index  index
val  value
delimeter  delimeter

Implements terimber_db_value_vector.

Definition at line 181 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_decimal ( size_t  index,
const char *  val,
char  delimeter 
) [virtual]

sets value as a decimal

Parameters:
index  index
val  value
delimeter  delimeter

Implements terimber_db_value_vector.

Definition at line 190 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_date ( size_t  index,
ub4_t  year,
ub1_t  month,
ub1_t  day,
ub1_t  hour,
ub1_t  minute,
ub1_t  second,
ub2_t  millisec 
) [virtual]

sets value as a date

Parameters:
index  index
year  years [0-1000000]
month  months [1 - 12]
day  days [1 - 31]
hour  hours [0 - 23]
minute  minutes [0 - 59]
second  seconds [0 - 59]
millisec  milliseconds [0 - 999]

Implements terimber_db_value_vector.

Definition at line 199 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_string ( size_t  index,
const char *  val,
size_t  len 
) [virtual]

sets value as a string for 0 terminated string len can be -1

Parameters:
index  index
val  string pointer
len  string length

Implements terimber_db_value_vector.

Definition at line 208 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_string_ptr ( size_t  index,
const char *  val 
) [virtual]

sets value as a string pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed. it is supposed to work only for input parameters, not for output or input/output ones

Parameters:
index  index
val  string pointer

Implements terimber_db_value_vector.

Definition at line 217 of file memlookup.cpp.

References _value, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_wstring ( size_t  index,
const wchar_t val,
size_t  len 
) [virtual]

sets value as a wide string for 0 terminated string len can be -1

Parameters:
index  index
val  string pointer
len  string length

Implements terimber_db_value_vector.

Definition at line 226 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_wstring_ptr ( size_t  index,
const wchar_t val 
) [virtual]

sets value as a wide string pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed.

Parameters:
index  index
val  string pointer

Implements terimber_db_value_vector.

Definition at line 235 of file memlookup.cpp.

References _value, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_binary ( size_t  index,
const ub1_t val,
size_t  len 
) [virtual]

sets value as a binary val points to the valid buffer of raw byte of "len" length

Parameters:
index  index
val  value pointer
len  length of bytes

Implements terimber_db_value_vector.

Definition at line 245 of file memlookup.cpp.

References _value, db_param_in, and base_vector< T >::size().

bool terimber_db_value_vector_impl::set_value_as_binary_ptr ( size_t  index,
const ub1_t val 
) [virtual]

sets value as a binary pointer to avoid copying already allocated memory, only the pointer can be used be careful! the caller is responsible for the life time of the provided pointer, which has to be valid until the sql statement has been executed. the format of the buffer must be as follows first size_t bytes the length of the rest of buffer, which contains the raw byte data it is supposed to work only for input parameters, not for output or input/output ones

Parameters:
index  index
val  value pointer

Implements terimber_db_value_vector.

Definition at line 254 of file memlookup.cpp.

References _value, and base_vector< T >::size().

bool terimber_db_value_vector_impl::get_value_is_null ( size_t  index  )  const [virtual]

checks if the value is null

gets values

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 264 of file memlookup.cpp.

References _value, and base_vector< T >::size().

bool terimber_db_value_vector_impl::get_value_as_bool ( size_t  index  )  const [virtual]

gets the value as a boolean

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 273 of file memlookup.cpp.

References _terimber_xml_value_::boolVal, get_value_as_value(), and vt_bool.

sb1_t terimber_db_value_vector_impl::get_value_as_char ( size_t  index  )  const [virtual]

gets the value as a char

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 279 of file memlookup.cpp.

References _terimber_xml_value_::cVal, get_value_as_value(), and vt_sb1.

ub1_t terimber_db_value_vector_impl::get_value_as_byte ( size_t  index  )  const [virtual]

gets the value as a byte

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 285 of file memlookup.cpp.

References _terimber_xml_value_::bVal, get_value_as_value(), and vt_ub1.

sb2_t terimber_db_value_vector_impl::get_value_as_short ( size_t  index  )  const [virtual]

gets the value as a short

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 291 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::iVal, and vt_sb2.

ub2_t terimber_db_value_vector_impl::get_value_as_word ( size_t  index  )  const [virtual]

gets the value as an unsigned short

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 297 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::uiVal, and vt_ub2.

sb4_t terimber_db_value_vector_impl::get_value_as_long ( size_t  index  )  const [virtual]

gets the value as a long

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 303 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::lVal, and vt_sb4.

ub4_t terimber_db_value_vector_impl::get_value_as_dword ( size_t  index  )  const [virtual]

gets the value as an unsigned long

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 309 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::ulVal, and vt_ub4.

float terimber_db_value_vector_impl::get_value_as_float ( size_t  index  )  const [virtual]

gets the value as a float

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 315 of file memlookup.cpp.

References _terimber_xml_value_::fltVal, get_value_as_value(), and vt_float.

double terimber_db_value_vector_impl::get_value_as_double ( size_t  index  )  const [virtual]

gets the value as a double

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 321 of file memlookup.cpp.

References _terimber_xml_value_::dblVal, get_value_as_value(), and vt_double.

sb8_t terimber_db_value_vector_impl::get_value_as_long64 ( size_t  index  )  const [virtual]

gets the value as a int32

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 332 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::intVal, and vt_sb8.

ub8_t terimber_db_value_vector_impl::get_value_as_dword64 ( size_t  index  )  const [virtual]

gets the value as an unsigned int32

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 343 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::uintVal, and vt_ub8.

bool terimber_db_value_vector_impl::get_value_as_guid ( size_t  index,
guid_t val 
) const [virtual]

gets the value as a guid for higher performance we are using reference

Parameters:
index  index
val  [out] value

Implements terimber_db_value_vector.

Definition at line 355 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::guidVal, and vt_guid.

const char * terimber_db_value_vector_impl::get_value_as_numeric ( size_t  index,
char  delimeter 
) const [virtual]

const char * terimber_db_value_vector_impl::get_value_as_decimal ( size_t  index,
char  delimeter 
) const [virtual]

gets the value as a deciaml

Parameters:
index  index
delimeter  delimeter

Implements terimber_db_value_vector.

Definition at line 392 of file memlookup.cpp.

References get_value_as_numeric().

bool terimber_db_value_vector_impl::get_value_as_date ( size_t  index,
ub4_t year,
ub1_t month,
ub1_t day,
ub1_t hour,
ub1_t minute,
ub1_t second,
ub2_t millisec,
ub1_t wday,
ub2_t yday 
) const [virtual]

gets the value as a date

Parameters:
index  index
year  [out] year [0-1000000]
month  [out] month [1-12]
day  [out] day [1-31]
hour  [out] hour [0-23]
minute  [out] minute [0-59]
second  [out] second [0-59]
millisec  [out] millisecond [0-999]
wday  [out] day of week [1-7]
yday  [out] day of year [1-366]

Implements terimber_db_value_vector.

Definition at line 399 of file memlookup.cpp.

References date::convert_from(), get_value_as_value(), _terimber_xml_value_::intVal, and vt_date.

const char * terimber_db_value_vector_impl::get_value_as_string ( size_t  index  )  const [virtual]

gets the value as a string function returns the pointer to string

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 415 of file memlookup.cpp.

References get_value_as_value(), _terimber_xml_value_::strVal, and vt_string.

const wchar_t * terimber_db_value_vector_impl::get_value_as_wstring ( size_t  index  )  const [virtual]

gets the value as a wide string function returns the pointer to wide string

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 422 of file memlookup.cpp.

References get_value_as_value(), vt_wstring, and _terimber_xml_value_::wstrVal.

const ub1_t * terimber_db_value_vector_impl::get_value_as_binary ( size_t  index,
size_t &  len 
) const [virtual]

gets the value as a binary returns pointer to the raw bytes size of bytes is put to len

Parameters:
index  index
len  [out] length

Implements terimber_db_value_vector.

Definition at line 431 of file memlookup.cpp.

References _terimber_xml_value_::bufVal, get_value_as_value(), and vt_binary.

const ub1_t * terimber_db_value_vector_impl::get_value_as_binary_ptr ( size_t  index  )  const [virtual]

gets the value as a binary pointer for reusing only the format of buffer is as follows first size_t bytes the length of the rest of buffer, which contains the raw byte data

Parameters:
index  index

Implements terimber_db_value_vector.

Definition at line 443 of file memlookup.cpp.

References _terimber_xml_value_::bufVal, get_value_as_value(), and vt_binary.


Member Data Documentation

temporary allocator

Definition at line 388 of file memdb.h.

Referenced by get_value_as_numeric(), and get_value_as_value().


The documentation for this class was generated from the following files:


© Copyright Terimber 2003-.