Home / Open source / Terimber 2.0
varmap< T, C > Class Template Referencetemplate class with main map (searchable property --> map of unique objects)
More...
#include <varmap.h>
List of all members.
|
Public Types |
typedef map< main_map_key,
mainmap_object_t,
main_map_key_compare > | mainmap_t |
| main map itself
|
typedef TYPENAME
mainmap_t::const_iterator | mainmap_citer_t |
| const iterator for main map
|
typedef TYPENAME
mainmap_t::iterator | mainmap_iter_t |
| iterator for main map
|
typedef TYPENAME
mainmap_t::pairib_t | mainmap_pairib_t |
| pair < iterator, bool > for main map
|
Public Member Functions |
| varmap (vt_types type, bool partial, bool fuzzy, variant_factory &factory) |
| constructor
|
| ~varmap () |
| destructor
|
mainmap_iter_t | add_resource (const main_map_key &res, const T &x) |
| finds/adds resource
|
mainmap_iter_t | end () |
| returns end iterator
|
bool | find_exact_resource (const main_map_key &res, C &x, const T &min_filter, const T &max_filter) const |
| finds the exact resource adding to those that is already in the container if any
|
bool | find_less_resource (const main_map_key &res, C &x, const T &min_filter, const T &max_filter, bool boundary_include) const |
| finds the range of resources "<" , "<="
|
bool | find_greater_resource (const main_map_key &res, C &x, const T &min_filter, const T &max_filter, bool boundary_include) const |
| finds the range of resources ">", ">='
|
bool | intersect_exact_resource (const main_map_key &res, C &x, const T &min_filter, const T &max_filter) const |
| finding the exact resource and keep in the container only those that intersect with the new found ones
|
bool | intersect_less_resource (const main_map_key &res, C &x, const T &min_filter, const T &max_filter, bool boundary_include) const |
| intersects the range of resources "<" , "<="
|
bool | intersect_greater_resource (const main_map_key &res, C &x, const T &min_filter, const T &max_filter, bool boundary_include) const |
| intersects the range of resources ">", ">='
|
bool | remove_resource (mainmap_iter_t iter, const T &x) |
| removes the resource from the container by iter(key)/value pair
|
size_t | remove_all_resource (const T &x) |
| removes specific resource from all keys returns the number removed items
|
void | fetch_all (C &x) const |
| extracts all resources from varmap
|
void | clear () |
| removes all resources from container
|
bool | find_partial_resource (const main_map_key &res, bool deep, C &x, const T &min_filter, const T &max_filter) const |
| finds partial match
|
bool | intersect_partial_resource (const main_map_key &res, bool deep, C &x, const T &min_filter, const T &max_filter) const |
| intersects partial match
|
bool | find_fuzzy_resource (const _list< size_t > &fuzzy_container, C &x, const T &min_filter, const T &max_filter) const |
| finds fuzzy match
|
bool | intersect_fuzzy_resource (const _list< size_t > &fuzzy_container, C &x, const T &min_filter, const T &max_filter) const |
| intersects fuzzy match
|
size_t | get_main_object_allocator_pages () const |
| returns allocated pages
|
size_t | get_main_object_allocator_capacity () const |
| returns allocators capacity
|
template<class F> |
void | retrive_stats (F &r) |
| rertives statistic
|
Static Public Member Functions |
static void | get_common_items (mainmap_citer_t c, const C &r, const T &min_filter, const T &max_filter, size_t &entries) |
| finds common items
|
static bool | add_unique_items (mainmap_citer_t c, C &r, const T &min_filter, const T &max_filter) |
| adds unique items to the container
|
static void | remove_uncommon_items (mainmap_citer_t c, C &r, const T &min_filter, const T &max_filter) |
| removes uncommon items from container
|
static void | mark_common_items (mainmap_citer_t c, C &r, const T &min_filter, const T &max_filter) |
| marks common items
|
Protected Attributes |
vt_types | _type |
| variant type
|
main_map_key_compare | _compare |
| compare predicate
|
mainmap_t | _mainmap |
| main map
|
mainmap_object_allocator_t | _main_object_allocator |
| main map allocator
|
variant_factory & | _factory |
| refrence to memory factory
|
bool | _partial |
| flag partial match
|
bool | _fuzzy |
| flag fuzzy match
|
Private Types |
typedef node_allocator
< TYPENAME base_map< T, bool >
::_node > | mainmap_object_allocator_t |
| allocator for map
|
typedef _map< T, bool,
mainmap_object_allocator_t > | mainmap_object_t |
| main map list of objects
|
typedef map< offset_map_key,
bool, less< offset_map_key >
, true > | offsetmap_t |
| offset map
|
typedef offsetmap_t::const_iterator | offsetmap_citer_t |
| const iterator for offsetmap_t
|
typedef offsetmap_t::iterator | offsetmap_iter_t |
| iterator for offsetmap_t
|
Private Attributes |
offsetmap_t | _offsetmap |
| offset map
|
Classes |
class | offset_map_key |
| offset map key More...
|
Detailed Description
template<class T, class C>
class varmap< T, C >
template class with main map (searchable property --> map of unique objects)
Definition at line 129 of file varmap.h.
Member Typedef Documentation
template<class T, class C>
template<class T, class C>
template<class T, class C>
main map itself
mandatory defined types
Definition at line 142 of file varmap.h.
template<class T, class C>
template<class T, class C>
template<class T, class C>
template<class T, class C>
template<class T, class C>
const iterator for offsetmap_t
Definition at line 409 of file varmap.h.
template<class T, class C>
iterator for offsetmap_t
Definition at line 412 of file varmap.h.
Constructor & Destructor Documentation
template<class T, class C>
template<class T, class C>
Member Function Documentation
template<class T, class C>
finds/adds resource
- Parameters:
-
res |
input key |
x |
input value |
Definition at line 381 of file varmap.hpp.
References varmap< T, C >::_factory, varmap< T, C >::_fuzzy, var_string_fuzzy_key::_fuzzy_key, var_key::_key, varmap< T, C >::_main_object_allocator, varmap< T, C >::_mainmap, var_key::_ngram, varmap< T, C >::_offsetmap, varmap< T, C >::_partial, var_string_searchable_key::_res, varmap< T, C >::_type, var_key::_val, main_map_key::_var_res, base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), map< K, T, Pr, M >::insert(), and TYPENAME.
Referenced by var_object_repository::insert_object(), and var_object_repository::update_object().
template<class T, class C>
template<class T, class C>
bool varmap< T, C >::find_exact_resource |
( |
const main_map_key & |
res, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | const [inline] |
finds the exact resource adding to those that is already in the container if any
- Parameters:
-
res |
input key |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 121 of file varmap.hpp.
References varmap< T, C >::_mainmap, varmap< T, C >::add_unique_items(), base_map< K, T, Pr, M >::end(), and base_map< K, T, Pr, M >::find().
Referenced by var_object_repository::find_by_row(), and var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::find_less_resource |
( |
const main_map_key & |
res, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter, |
|
|
bool |
boundary_include | |
|
) |
| | const [inline] |
finds the range of resources "<" , "<="
- Parameters:
-
res |
input key |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
boundary_include |
flag include bounderies |
Definition at line 139 of file varmap.hpp.
References varmap< T, C >::_mainmap, varmap< T, C >::add_unique_items(), base_map< K, T, Pr, M >::begin(), base_map< K, T, Pr, M >::lower_bound(), and base_map< K, T, Pr, M >::upper_bound().
Referenced by var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::find_greater_resource |
( |
const main_map_key & |
res, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter, |
|
|
bool |
boundary_include | |
|
) |
| | const [inline] |
finds the range of resources ">", ">='
- Parameters:
-
res |
input key |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
boundary_include |
flag include bounderies |
Definition at line 164 of file varmap.hpp.
References varmap< T, C >::_mainmap, varmap< T, C >::add_unique_items(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), and base_map< K, T, Pr, M >::upper_bound().
Referenced by var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::intersect_exact_resource |
( |
const main_map_key & |
res, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | const [inline] |
finding the exact resource and keep in the container only those that intersect with the new found ones
- Parameters:
-
res |
input key |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 193 of file varmap.hpp.
References varmap< T, C >::_mainmap, base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), and varmap< T, C >::remove_uncommon_items().
Referenced by var_object_repository::find_by_row(), and var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::intersect_less_resource |
( |
const main_map_key & |
res, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter, |
|
|
bool |
boundary_include | |
|
) |
| | const [inline] |
intersects the range of resources "<" , "<="
- Parameters:
-
res |
input key |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
boundary_include |
flag include bounderies |
Definition at line 212 of file varmap.hpp.
References varmap< T, C >::_mainmap, base_map< K, T, Pr, M >::begin(), base_map< K, T, Pr, M >::lower_bound(), varmap< T, C >::mark_common_items(), TYPENAME, and base_map< K, T, Pr, M >::upper_bound().
Referenced by var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::intersect_greater_resource |
( |
const main_map_key & |
res, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter, |
|
|
bool |
boundary_include | |
|
) |
| | const [inline] |
intersects the range of resources ">", ">='
- Parameters:
-
res |
input key |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
boundary_include |
flag include bounderies |
Definition at line 241 of file varmap.hpp.
References varmap< T, C >::_mainmap, base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), varmap< T, C >::mark_common_items(), TYPENAME, and base_map< K, T, Pr, M >::upper_bound().
Referenced by var_object_repository::process_condition().
template<class T, class C>
removes the resource from the container by iter(key)/value pair
- Parameters:
-
iter |
interator to the main map |
x |
resource for removal |
Definition at line 437 of file varmap.hpp.
References varmap< T, C >::_factory, varmap< T, C >::_fuzzy, varmap< T, C >::_main_object_allocator, varmap< T, C >::_mainmap, var_value::_not_null, varmap< T, C >::_offsetmap, varmap< T, C >::_partial, varmap< T, C >::_type, var_value::_value, _terimber_xml_value_::bufVal, variant_factory::destroy(), base_map< K, T, Pr, M >::end(), map< K, T, Pr, M >::erase(), base_map< K, T, Pr, M >::lower_bound(), _terimber_xml_value_::strVal, TYPENAME, base_map< K, T, Pr, M >::upper_bound(), and vt_numeric.
Referenced by var_object_repository::delete_object(), and var_object_repository::update_object().
template<class T, class C>
size_t varmap< T, C >::remove_all_resource |
( |
const T & |
x |
) |
[inline] |
removes specific resource from all keys returns the number removed items
- Parameters:
-
Definition at line 55 of file varmap.hpp.
References varmap< T, C >::_factory, varmap< T, C >::_fuzzy, varmap< T, C >::_main_object_allocator, varmap< T, C >::_mainmap, var_value::_not_null, varmap< T, C >::_partial, varmap< T, C >::_type, var_value::_value, base_map< K, T, Pr, M >::begin(), _terimber_xml_value_::bufVal, variant_factory::destroy(), base_map< K, T, Pr, M >::end(), map< K, T, Pr, M >::erase(), _terimber_xml_value_::strVal, TYPENAME, and vt_numeric.
template<class T, class C>
void varmap< T, C >::fetch_all |
( |
C & |
x |
) |
const [inline] |
extracts all resources from varmap
- Parameters:
-
Definition at line 274 of file varmap.hpp.
References varmap< T, C >::_mainmap, varmap< T, C >::add_unique_items(), base_map< K, T, Pr, M >::begin(), and base_map< K, T, Pr, M >::end().
template<class T, class C>
void varmap< T, C >::clear |
( |
|
) |
[inline] |
removes all resources from container
Definition at line 287 of file varmap.hpp.
References varmap< T, C >::_factory, varmap< T, C >::_main_object_allocator, varmap< T, C >::_mainmap, var_value::_not_null, varmap< T, C >::_offsetmap, varmap< T, C >::_partial, varmap< T, C >::_type, var_value::_value, base_map< K, T, Pr, M >::begin(), _terimber_xml_value_::bufVal, map< K, T, Pr, M >::clear(), rep_allocator::clear_all(), variant_factory::destroy(), base_map< K, T, Pr, M >::end(), _terimber_xml_value_::strVal, and vt_numeric.
Referenced by var_object_repository::reset(), and varmap< T, C >::~varmap().
template<class T, class C>
bool varmap< T, C >::find_partial_resource |
( |
const main_map_key & |
res, |
|
|
bool |
deep, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | const [inline] |
finds partial match
- Parameters:
-
res |
input key |
deep |
flag match partially deeply |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 505 of file varmap.hpp.
References var_key::_key, varmap< T, C >::_mainmap, varmap< T, C >::_offsetmap, varmap< T, C >::_partial, var_string_searchable_key::_res, main_map_key::_var_res, varmap< T, C >::add_unique_items(), base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::end(), and base_map< K, T, Pr, M >::lower_bound().
Referenced by var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::intersect_partial_resource |
( |
const main_map_key & |
res, |
|
|
bool |
deep, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | const [inline] |
intersects partial match
- Parameters:
-
res |
input key |
deep |
flag match partially deeply |
x |
output container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 550 of file varmap.hpp.
References var_key::_key, varmap< T, C >::_mainmap, varmap< T, C >::_offsetmap, varmap< T, C >::_partial, var_string_searchable_key::_res, main_map_key::_var_res, base_map< K, T, Pr, M >::empty(), base_map< K, T, Pr, M >::end(), base_map< K, T, Pr, M >::find(), base_map< K, T, Pr, M >::lower_bound(), varmap< T, C >::mark_common_items(), and TYPENAME.
Referenced by var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::find_fuzzy_resource |
( |
const _list< size_t > & |
fuzzy_container, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | const [inline] |
finds fuzzy match
- Parameters:
-
fuzzy_container |
input ident container |
x |
output resource container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 605 of file varmap.hpp.
References varmap< T, C >::_fuzzy, varmap< T, C >::_mainmap, varmap< T, C >::add_unique_items(), base_list< T >::begin(), base_map< K, T, Pr, M >::end(), base_list< T >::end(), base_map< K, T, Pr, M >::lower_bound(), and TYPENAME.
Referenced by var_object_repository::process_condition().
template<class T, class C>
bool varmap< T, C >::intersect_fuzzy_resource |
( |
const _list< size_t > & |
fuzzy_container, |
|
|
C & |
x, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | const [inline] |
intersects fuzzy match
- Parameters:
-
fuzzy_container |
input ident container |
x |
output resource container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 630 of file varmap.hpp.
References varmap< T, C >::_mainmap, base_list< T >::begin(), base_map< K, T, Pr, M >::end(), base_list< T >::end(), base_map< K, T, Pr, M >::lower_bound(), varmap< T, C >::mark_common_items(), and TYPENAME.
Referenced by var_object_repository::process_condition().
template<class T, class C>
void varmap< T, C >::get_common_items |
( |
mainmap_citer_t |
c, |
|
|
const C & |
r, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter, |
|
|
size_t & |
entries | |
|
) |
| | [inline, static] |
finds common items
- Parameters:
-
c |
input iterator to main map |
r |
input resource container |
min_filter |
min boundary |
max_filter |
max boundary |
entries |
[out] entries |
Definition at line 317 of file varmap.hpp.
References TYPENAME.
template<class T, class C>
bool varmap< T, C >::add_unique_items |
( |
mainmap_citer_t |
c, |
|
|
C & |
r, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | [inline, static] |
adds unique items to the container
- Parameters:
-
c |
input iterator to main map |
r |
resource container |
min_filter |
min boundary |
max_filter |
max boundary |
Definition at line 345 of file varmap.hpp.
References TYPENAME.
Referenced by varmap< T, C >::fetch_all(), varmap< T, C >::find_exact_resource(), varmap< T, C >::find_fuzzy_resource(), varmap< T, C >::find_greater_resource(), varmap< T, C >::find_less_resource(), and varmap< T, C >::find_partial_resource().
template<class T, class C>
void varmap< T, C >::remove_uncommon_items |
( |
mainmap_citer_t |
c, |
|
|
C & |
r, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | [inline, static] |
template<class T, class C>
void varmap< T, C >::mark_common_items |
( |
mainmap_citer_t |
c, |
|
|
C & |
r, |
|
|
const T & |
min_filter, |
|
|
const T & |
max_filter | |
|
) |
| | [inline, static] |
template<class T, class C>
size_t varmap< T, C >::get_main_object_allocator_pages |
( |
|
) |
const [inline] |
template<class T, class C>
size_t varmap< T, C >::get_main_object_allocator_capacity |
( |
|
) |
const [inline] |
template<class T, class C>
template<class F>
void varmap< T, C >::retrive_stats |
( |
F & |
r |
) |
[inline] |
rertives statistic
- Parameters:
-
Definition at line 323 of file varmap.h.
Member Data Documentation
template<class T, class C>
template<class T, class C>
compare predicate
Definition at line 334 of file varmap.h.
template<class T, class C>
main map
Definition at line 335 of file varmap.h.
Referenced by varmap< T, C >::add_resource(), varmap< T, C >::clear(), varmap< T, C >::end(), varmap< T, C >::fetch_all(), 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(), 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(), varmap< T, C >::remove_all_resource(), varmap< T, C >::remove_resource(), and varmap< pk_column, var_container >::retrive_stats().
template<class T, class C>
main map allocator
Definition at line 336 of file varmap.h.
Referenced by varmap< T, C >::add_resource(), varmap< T, C >::clear(), varmap< T, C >::get_main_object_allocator_capacity(), varmap< T, C >::get_main_object_allocator_pages(), varmap< T, C >::remove_all_resource(), and varmap< T, C >::remove_resource().
template<class T, class C>
template<class T, class C>
flag partial match
Definition at line 338 of file varmap.h.
Referenced by varmap< T, C >::add_resource(), varmap< T, C >::clear(), varmap< T, C >::find_partial_resource(), varmap< T, C >::intersect_partial_resource(), varmap< T, C >::remove_all_resource(), varmap< T, C >::remove_resource(), and varmap< T, C >::varmap().
template<class T, class C>
template<class T, class C>
The documentation for this class was generated from the following files:
|
|