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

var_object_repository Class Reference

class where all maps resides More...

#include <varobj.h>

List of all members.

Public Types

typedef array_allocator
< var_object_map_t::mainmap_iter_t
iter_vec_allocator_t
 allocator for iterator vector
typedef _vector
< var_object_map_t::mainmap_iter_t,
iter_vec_allocator_t
iter_vector_t
 vector of iterators
typedef node_allocator< _map
< size_t, iter_vector_t >
::_node > 
object_map_allocator_t
 map allocator
typedef _map< size_t,
iter_vector_t,
object_map_allocator_t
object_map_data_t
 maps rowid to the vector of iterators

Public Member Functions

 var_object_repository (const var_object_repository &x)
 copy constructor
var_object_repositoryoperator= (const var_object_repository &x)
 assign operator
 var_object_repository (const var_object_schema &schema)
 constructor
 ~var_object_repository ()
 destructor
void reset ()
 clear and reuse object
size_t count () const
 count rows
bool process_query (xml_designer *parser, var_container::sorted_container_allocator_t &all, byte_allocator &tmp, byte_allocator &inl)
 processes xml query
bool select_object (size_t pk, var_object_values &row, byte_allocator &tmp) const
 find by pk
bool select_object (const var_object_values &key, var_object_values &row, byte_allocator &tmp, var_container::sorted_container_allocator_t &conall, size_t &pk) const
 find by unique key
size_t insert_object (const var_object_values &values, byte_allocator &tmp, byte_allocator &inl, string_t &err)
 adds new object to the repository the length of object must excatly match the length of var_object_schema returns primary key
bool delete_object (size_t pk, byte_allocator &tmp, string_t &err)
 deletes existed object from the repository
bool delete_object (const var_object_values &key, byte_allocator &tmp, byte_allocator &inl, string_t &err)
 deletes existed object from the repository
bool update_object (size_t pk, const var_object_values &values, byte_allocator &tmp, byte_allocator &inl, string_t &err)
 updates existed object from the repository
bool find_by_conditions (const xml_designer *parser, var_container &container, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 find pks by conditions
bool find_by_condition (const xml_designer *parser, var_container &container, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 find pks by conditions
bool find_by_row (const var_object_values &values, var_container &container, byte_allocator &tmp) const
 find pks by foreign key

Private Member Functions

vt_types cast_to_common_type (vt_types type, const var_value &in, var_value &out, byte_allocator &tmp) const
 converts value to common type
vt_types map_type (vt_types type) const
 map types
bool process_returns (const xml_designer *parser, list_returns_index_t &container, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 processes selected columns
bool process_values (const xml_designer *parser, var_object_values &container, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 processes VALUES clause
bool process_where (const xml_designer *parser, var_container &container, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 processes WHERE clause
bool process_condition (const xml_designer *parser, var_container &container, bool intersect, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 processes conditions
bool process_group (const xml_designer *parser, var_container &container, bool intersect, byte_allocator &tmp, byte_allocator &inl, string_t &err) const
 processes group conditions recursively
bool process_error (xml_designer *parser, const char *err) const
 processes error
const var_object_map_tget_v_object_pointer (vt_types type, bool searchable) const
 returns the object by type const verstion
var_object_map_tget_v_object_pointer (vt_types type, bool searchable)
 returns the object by type

Private Attributes

const var_object_schema_schema
 schema for this object
unique_key_generator _key_generator
 unique key generator
variant_factory _var_factory
 variant factory
var_object_map_t _uint32_type_map
 bool, byte, short, long - all goes to the int_t map
var_object_map_t _double_type_map
 float, double map
var_object_map_t _uint64_type_map
 long long and date type
var_object_map_t _string_type_map
 string, wstring (will be converted into utf-8)
var_object_map_t _searchable_string_type_map
 partial searchable, string, wstring (will be converted into utf-8)
var_object_map_t _fuzzy_string_type_map
 fuzzy match searchable, string, wstring (will be converted into utf-8)
var_object_map_t _numeric_type_map
 decimal, numeric
var_object_map_t _binary_type_map
 binary
var_object_map_t _guid_type_map
 guid
object_map_allocator_t _objs_all
 size_t is a unique rowid pointing to the iterator for the correspondent map
iter_vec_allocator_t _iter_vec_all
 allocator for iterators
object_map_data_t _objs_map
 actual map to the iterators
fuzzy_matcher_fuzzy_engine
 fuzzy match engine


Detailed Description

class where all maps resides

Definition at line 166 of file varobj.h.


Member Typedef Documentation

allocator for iterator vector

Definition at line 171 of file varobj.h.

vector of iterators

Definition at line 174 of file varobj.h.

map allocator

Definition at line 177 of file varobj.h.

maps rowid to the vector of iterators

Definition at line 180 of file varobj.h.


Constructor & Destructor Documentation

var_object_repository::var_object_repository ( const var_object_repository x  ) 

copy constructor

var_object_repository::var_object_repository ( const var_object_schema schema  ) 

constructor

Parameters:
schema  schema

Definition at line 105 of file varobj.cpp.

References _fuzzy_engine, and fuzzy_matcher_factory::get_fuzzy_matcher().

var_object_repository::~var_object_repository (  ) 

destructor

Definition at line 121 of file varobj.cpp.

References _fuzzy_engine.


Member Function Documentation

var_object_repository& var_object_repository::operator= ( const var_object_repository x  ) 

assign operator

size_t var_object_repository::count (  )  const

count rows

Definition at line 154 of file varobj.cpp.

References _objs_map, and base_map< K, T, Pr, M >::size().

bool var_object_repository::select_object ( size_t  pk,
var_object_values row,
byte_allocator tmp 
) const

find by pk

non xml level

Parameters:
pk  primary key
row  row values
tmp  temporary allocator

Definition at line 1230 of file varobj.cpp.

References _objs_map, _schema, base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), and _vector< T, A >::resize().

Referenced by select_object().

bool var_object_repository::select_object ( const var_object_values key,
var_object_values row,
byte_allocator tmp,
var_container::sorted_container_allocator_t conall,
size_t &  pk 
) const

find by unique key

non xml level

Parameters:
key  unique key
row  row values
tmp  temporary allocator
conall  container allocator
pk  returns internal pk

Definition at line 1272 of file varobj.cpp.

References var_container::_container, find_by_row(), and select_object().

size_t var_object_repository::insert_object ( const var_object_values values,
byte_allocator tmp,
byte_allocator inl,
string_t err 
)

adds new object to the repository the length of object must excatly match the length of var_object_schema returns primary key

Parameters:
values  db row
tmp  temporary allocator
inl  inline allocator
err  [out] error

Definition at line 843 of file varobj.cpp.

References _fuzzy_engine, _iter_vec_all, _key_generator, _objs_all, _objs_map, _schema, var_value::_value, fuzzy_matcher::add(), varmap< T, C >::add_resource(), base_vector< T >::begin(), cast_to_common_type(), base_vector< T >::end(), unique_key_generator::generate(), get_v_object_pointer(), _map< K, T, A, Pr, M >::insert(), _vector< T, A >::resize(), base_vector< T >::size(), and _terimber_xml_value_::strVal.

Referenced by process_query().

bool var_object_repository::delete_object ( size_t  pk,
byte_allocator tmp,
string_t err 
)

bool var_object_repository::delete_object ( const var_object_values key,
byte_allocator tmp,
byte_allocator inl,
string_t err 
)

deletes existed object from the repository

find by unique key

non xml level

Parameters:
key  key
tmp  temporary allocator
inl  inline allocator
err  [out] error

Definition at line 1297 of file varobj.cpp.

References var_container::_container, delete_object(), find_by_row(), and byte_allocator::reset().

bool var_object_repository::update_object ( size_t  pk,
const var_object_values values,
byte_allocator tmp,
byte_allocator inl,
string_t err 
)

bool var_object_repository::find_by_conditions ( const xml_designer parser,
var_container container,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const

find pks by conditions

Parameters:
parser  xml designer
container  [out] container of values
tmp  temporary allocator
inl  inline allocator
err  [out] error

Definition at line 1322 of file varobj.cpp.

References process_where().

bool var_object_repository::find_by_condition ( const xml_designer parser,
var_container container,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const

find pks by conditions

find pks by a single condition

Parameters:
parser  xml designer
container  [out] container of values
tmp  temporary allocator
inl  inline allocator
err  [out] error

Definition at line 1334 of file varobj.cpp.

References process_condition().

bool var_object_repository::find_by_row ( const var_object_values values,
var_container container,
byte_allocator tmp 
) const

find pks by foreign key

Parameters:
values  row with conditions
container  [out] container of values
tmp  temporary allocator

Definition at line 1345 of file varobj.cpp.

References _schema, base_vector< T >::begin(), cast_to_common_type(), base_vector< T >::end(), varmap< T, C >::find_exact_resource(), get_v_object_pointer(), varmap< T, C >::intersect_exact_resource(), and base_vector< T >::size().

Referenced by delete_object(), and select_object().

vt_types var_object_repository::map_type ( vt_types  type  )  const [private]

map types

Parameters:
type  variant type

Definition at line 1122 of file varobj.cpp.

References vt_binary, vt_bool, vt_date, vt_decimal, vt_double, vt_empty, vt_enum, vt_float, vt_guid, vt_null, vt_numeric, vt_sb1, vt_sb2, vt_sb4, vt_sb8, vt_string, vt_ub1, vt_ub2, vt_ub4, vt_ub8, vt_unknown, and vt_wstring.

Referenced by delete_object().

bool var_object_repository::process_returns ( const xml_designer parser,
list_returns_index_t container,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const [private]

processes selected columns

Parameters:
parser  xml designer
container  [out] list of return columns
tmp  temporary allocator
inl  inline allocator
err  [out] error

Definition at line 472 of file varobj.cpp.

References _schema, base_vector< T >::begin(), ELEMENT_NODE, base_vector< T >::end(), xml_designer::get_type(), xml_designer::get_value(), os_minus_one, _list< T, A >::push_back(), xml_designer::select_attribute_by_name(), xml_designer::select_first_child(), xml_designer::select_next_sibling(), xml_designer::select_parent(), base_vector< T >::size(), and str_template::strnocasecmp().

Referenced by process_query().

bool var_object_repository::process_values ( const xml_designer parser,
var_object_values container,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const [private]

bool var_object_repository::process_where ( const xml_designer parser,
var_container container,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const [private]

processes WHERE clause

Parameters:
parser  xml designer
container  [out] container of values
tmp  temporary allocator
inl  inline allocator
err  [out] error

Definition at line 429 of file varobj.cpp.

References ELEMENT_NODE, xml_designer::get_name(), xml_designer::get_type(), process_condition(), process_group(), xml_designer::select_first_child(), xml_designer::select_next_sibling(), and xml_designer::select_parent().

Referenced by find_by_conditions(), and process_query().

bool var_object_repository::process_condition ( const xml_designer parser,
var_container container,
bool  intersect,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const [private]

bool var_object_repository::process_group ( const xml_designer parser,
var_container container,
bool  intersect,
byte_allocator tmp,
byte_allocator inl,
string_t err 
) const [private]

processes group conditions recursively

Parameters:
parser  xml designer
container  [out] container of conditions
intersect  flag intersect
tmp  temporary allocator
inl  inline allocator

Definition at line 790 of file varobj.cpp.

References var_container::_allocator, var_container::combine(), ELEMENT_NODE, xml_designer::get_name(), xml_designer::get_type(), xml_designer::get_value(), var_container::intersect(), process_condition(), xml_designer::select_attribute_by_name(), xml_designer::select_first_child(), xml_designer::select_next_sibling(), and xml_designer::select_parent().

Referenced by process_where().

bool var_object_repository::process_error ( xml_designer parser,
const char *  err 
) const [private]

processes error

Parameters:
parser  xml designer
err  error

Definition at line 1217 of file varobj.cpp.

References xml_designer::add_child(), ATTRIBUTE_NODE, ELEMENT_NODE, xml_designer::load(), response_dtd, and str_template::strlen().

Referenced by process_query().

const var_object_map_t * var_object_repository::get_v_object_pointer ( vt_types  type,
bool  searchable 
) const [private]

returns the object by type const verstion

Parameters:
type  variant type
searchable  flag searchable

Definition at line 1191 of file varobj.cpp.

References _binary_type_map, _double_type_map, _guid_type_map, _numeric_type_map, _searchable_string_type_map, _string_type_map, _uint32_type_map, _uint64_type_map, vt_binary, vt_double, vt_guid, vt_numeric, vt_string, vt_ub4, vt_ub8, and vt_unknown.

Referenced by delete_object(), find_by_row(), insert_object(), process_condition(), and update_object().

var_object_map_t * var_object_repository::get_v_object_pointer ( vt_types  type,
bool  searchable 
) [private]

returns the object by type

Parameters:
type  variant type
searchable  flag searchable

Definition at line 1165 of file varobj.cpp.

References _binary_type_map, _double_type_map, _guid_type_map, _numeric_type_map, _searchable_string_type_map, _string_type_map, _uint32_type_map, _uint64_type_map, vt_binary, vt_double, vt_guid, vt_numeric, vt_string, vt_ub4, vt_ub8, and vt_unknown.


Member Data Documentation

unique key generator

Definition at line 366 of file varobj.h.

Referenced by delete_object(), insert_object(), and reset().

variant factory

Definition at line 367 of file varobj.h.

Referenced by reset().

bool, byte, short, long - all goes to the int_t map

Definition at line 368 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

float, double map

Definition at line 369 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

long long and date type

Definition at line 370 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

string, wstring (will be converted into utf-8)

Definition at line 371 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

partial searchable, string, wstring (will be converted into utf-8)

Definition at line 372 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

fuzzy match searchable, string, wstring (will be converted into utf-8)

Definition at line 373 of file varobj.h.

Referenced by reset().

decimal, numeric

Definition at line 374 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

binary

Definition at line 375 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

guid

Definition at line 376 of file varobj.h.

Referenced by get_v_object_pointer(), and reset().

size_t is a unique rowid pointing to the iterator for the correspondent map

Definition at line 377 of file varobj.h.

Referenced by insert_object(), and reset().

allocator for iterators

Definition at line 378 of file varobj.h.

Referenced by delete_object(), insert_object(), and reset().


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


© Copyright Terimber 2003-.