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

varmap< T, C > Class Template Reference

template 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>
varmap< T, C >::mainmap_object_allocator_t [private]

allocator for map

Definition at line 133 of file varmap.h.

template<class T, class C>
varmap< T, C >::mainmap_object_t [private]

main map list of objects

Definition at line 136 of file varmap.h.

template<class T, class C>
varmap< T, C >::mainmap_t

main map itself

mandatory defined types

Definition at line 142 of file varmap.h.

template<class T, class C>
varmap< T, C >::mainmap_citer_t

const iterator for main map

Definition at line 145 of file varmap.h.

template<class T, class C>
varmap< T, C >::mainmap_iter_t

iterator for main map

Definition at line 148 of file varmap.h.

template<class T, class C>
varmap< T, C >::mainmap_pairib_t

pair < iterator, bool > for main map

Definition at line 151 of file varmap.h.

template<class T, class C>
varmap< T, C >::offsetmap_t [private]

offset map

Definition at line 406 of file varmap.h.

template<class T, class C>
varmap< T, C >::offsetmap_citer_t [private]

const iterator for offsetmap_t

Definition at line 409 of file varmap.h.

template<class T, class C>
varmap< T, C >::offsetmap_iter_t [private]

iterator for offsetmap_t

Definition at line 412 of file varmap.h.


Constructor & Destructor Documentation

template<class T, class C>
varmap< T, C >::varmap ( vt_types  type,
bool  partial,
bool  fuzzy,
variant_factory factory 
) [inline]

constructor

Parameters:
type  variant type
partial  flag partial match
fuzzy  flag fuzzy match
factory  memory factory

Definition at line 100 of file varmap.hpp.

References varmap< T, C >::_fuzzy, and varmap< T, C >::_partial.

template<class T, class C>
varmap< T, C >::~varmap (  )  [inline]

destructor

Definition at line 107 of file varmap.hpp.

References varmap< T, C >::clear().


Member Function Documentation

template<class T, class C>
TYPENAME varmap< T, C >::mainmap_iter_t varmap< T, C >::end (  )  [inline]

returns end iterator

Definition at line 114 of file varmap.hpp.

References varmap< T, C >::_mainmap, and base_map< K, T, Pr, M >::end().

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>
size_t varmap< T, C >::remove_all_resource ( const T &  x  )  [inline]

template<class T, class C>
void varmap< T, C >::fetch_all ( C &  x  )  const [inline]

extracts all resources from varmap

Parameters:
x  output container

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>
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]

removes uncommon items from container

Parameters:
c  input iterator to main map
r  resource container
min_filter  min boundary
max_filter  max boundary

Definition at line 692 of file varmap.hpp.

References TYPENAME.

Referenced by varmap< T, C >::intersect_exact_resource().

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]

marks common items

Parameters:
c  input iterator to main map
r  resource container
min_filter  min boundary
max_filter  max boundary

Definition at line 662 of file varmap.hpp.

References TYPENAME.

Referenced by varmap< T, C >::intersect_fuzzy_resource(), varmap< T, C >::intersect_greater_resource(), varmap< T, C >::intersect_less_resource(), and varmap< T, C >::intersect_partial_resource().

template<class T, class C>
size_t varmap< T, C >::get_main_object_allocator_pages (  )  const [inline]

returns allocated pages

any statistics

Definition at line 367 of file varmap.hpp.

References varmap< T, C >::_main_object_allocator, and byte_allocator::count().

template<class T, class C>
size_t varmap< T, C >::get_main_object_allocator_capacity (  )  const [inline]

returns allocators capacity

Definition at line 374 of file varmap.hpp.

References varmap< T, C >::_main_object_allocator, and byte_allocator::capacity().

template<class T, class C>
template<class F>
void varmap< T, C >::retrive_stats ( F &  r  )  [inline]

rertives statistic

Parameters:
r  fuction pointer

Definition at line 323 of file varmap.h.


Member Data Documentation

template<class T, class C>
vt_types varmap< T, C >::_type [protected]

template<class T, class C>
main_map_key_compare varmap< T, C >::_compare [protected]

compare predicate

Definition at line 334 of file varmap.h.

template<class T, class C>
variant_factory& varmap< T, C >::_factory [protected]

template<class T, class C>
bool varmap< T, C >::_fuzzy [protected]


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


© Copyright Terimber 2003-.