Home / Open source / Terimber 2.0
var_object_repository Class Referenceclass 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_repository & | operator= (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_t * | get_v_object_pointer (vt_types type, bool searchable) const |
| returns the object by type const verstion
|
var_object_map_t * | get_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
Constructor & Destructor Documentation
var_object_repository::~var_object_repository |
( |
|
) |
|
Member Function Documentation
void var_object_repository::reset |
( |
|
) |
|
clear and reuse object
Definition at line 129 of file varobj.cpp.
References _binary_type_map, _double_type_map, _fuzzy_engine, _fuzzy_string_type_map, _guid_type_map, _iter_vec_all, _key_generator, _numeric_type_map, _objs_all, _objs_map, _searchable_string_type_map, _string_type_map, _uint32_type_map, _uint64_type_map, _var_factory, varmap< T, C >::clear(), base_map< K, T, Pr, M >::clear(), unique_key_generator::clear(), fuzzy_matcher::reset(), variant_factory::reset(), and rep_allocator::reset().
size_t var_object_repository::count |
( |
|
) |
const |
processes xml query
- Parameters:
-
parser |
xml designer |
all |
container allocator |
tmp |
temporary allocator |
inl |
inline allocator |
Definition at line 213 of file varobj.cpp.
References var_container::_allocator, var_container::_container, _objs_map, _schema, xml_designer::add_child(), ATTRIBUTE_NODE, base_list< T >::begin(), delete_object(), ELEMENT_NODE, base_list< T >::end(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), xml_designer::get_value(), insert_object(), xml_designer::load(), persist_value(), process_error(), process_returns(), process_values(), process_where(), response_dtd, xml_designer::select_attribute_by_name(), xml_designer::select_parent(), xml_designer::select_xpath(), str_template::strlen(), str_template::strprint(), update_object(), and exception::what().
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().
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().
deletes existed object from the repository
- Parameters:
-
pk |
primary key |
tmp |
temporary allocator |
err |
[out] error |
Definition at line 900 of file varobj.cpp.
References _fuzzy_engine, _iter_vec_all, _key_generator, _objs_map, _schema, base_vector< T >::begin(), base_vector< T >::end(), base_map< K, T, Pr, M >::end(), _map< K, T, A, Pr, M >::erase(), base_map< K, T, Pr, M >::find(), get_v_object_pointer(), map_type(), fuzzy_matcher::remove(), varmap< T, C >::remove_resource(), and unique_key_generator::save().
Referenced by delete_object(), and process_query().
updates existed object from the repository
- Parameters:
-
pk |
primary key |
values |
new db row |
tmp |
temporary allocator |
inl |
inline allocator |
err |
[out] error |
Definition at line 946 of file varobj.cpp.
References _fuzzy_engine, _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(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), get_v_object_pointer(), fuzzy_matcher::remove(), varmap< T, C >::remove_resource(), base_vector< T >::size(), and _terimber_xml_value_::strVal.
Referenced by process_query().
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().
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().
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().
converts value to common type
- Parameters:
-
type |
variant type |
in |
input value |
out |
output value |
tmp |
temporary allocator |
Definition at line 1019 of file varobj.cpp.
References var_value::_not_null, var_value::_value, byte_allocator::allocate(), _terimber_xml_value_::boolVal, _terimber_xml_value_::bufVal, _terimber_xml_value_::bVal, _terimber_xml_value_::cVal, _terimber_xml_value_::dblVal, _terimber_xml_value_::fltVal, _terimber_xml_value_::guidVal, _terimber_xml_value_::intVal, _terimber_xml_value_::iVal, _terimber_xml_value_::lVal, os_minus_one, _terimber_xml_value_::strVal, _terimber_xml_value_::uintVal, _terimber_xml_value_::uiVal, _terimber_xml_value_::ulVal, str_template::unicode_to_multibyte(), 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, vt_wstring, and _terimber_xml_value_::wstrVal.
Referenced by find_by_row(), insert_object(), process_condition(), and update_object().
map types
- Parameters:
-
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().
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().
processes VALUES clause
- Parameters:
-
parser |
xml designer |
container |
[out] container of values |
tmp |
temporary allocator |
inl |
inline allocator |
err |
[out] error |
Definition at line 518 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, parse_value(), _vector< T, A >::resize(), xml_designer::select_attribute_by_name(), xml_designer::select_first_child(), xml_designer::select_next_sibling(), xml_designer::select_parent(), base_vector< T >::size(), str_template::strnocasecmp(), and exception::what().
Referenced by process_query().
processes conditions
- Parameters:
-
parser |
xml designer |
container |
[out] container of conditions |
intersect |
flag intersect |
tmp |
temporary allocator |
inl |
inline allocator |
err |
[out] error |
Definition at line 587 of file varobj.cpp.
References var_container::_allocator, var_container::_container, _fuzzy_engine, var_value::_not_null, _objs_map, _schema, var_value::_value, base_vector< T >::begin(), cast_to_common_type(), base_map< K, T, Pr, M >::end(), base_vector< T >::end(), base_map< K, T, Pr, M >::find(), varmap< T, C >::find_exact_resource(), varmap< T, C >::find_fuzzy_resource(), varmap< T, C >::find_greater_resource(), varmap< T, C >::find_less_resource(), varmap< T, C >::find_partial_resource(), get_v_object_pointer(), xml_designer::get_value(), varmap< T, C >::intersect_exact_resource(), varmap< T, C >::intersect_fuzzy_resource(), varmap< T, C >::intersect_greater_resource(), varmap< T, C >::intersect_less_resource(), varmap< T, C >::intersect_partial_resource(), base_string< T >::length(), fuzzy_matcher::match(), nq_high, nq_low, nq_normal, os_minus_one, parse_value(), pq_high, pq_low, pq_normal, xml_designer::select_attribute_by_name(), xml_designer::select_parent(), base_vector< T >::size(), str_template::strcmp(), _terimber_xml_value_::strVal, _terimber_xml_value_::ulVal, vt_string, vt_ub4, and exception::what().
Referenced by find_by_condition(), process_group(), and process_where().
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] |
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().
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
fuzzy match searchable, string, wstring (will be converted into utf-8)
Definition at line 373 of file varobj.h.
Referenced by reset().
The documentation for this class was generated from the following files:
|
|