NAME

ACE_Hash_Cache_Map_Manager - Defines a abstraction which will purge entries from a map. The map considered is the ACE_Hash_Map_Manager_Ex.

SYNOPSIS

#include <ace/Hash_Cache_Map_Manager.h>

template<class KEY, class VALUE, class HASH_KEY, class COMPARE_KEYS, class CACHING_STRATEGY, class ATTRIBUTES> class ACE_Hash_Cache_Map_Manager : public ACE_CACHE_MAP_MANAGER { public: typedef ACE_Pair<VALUE, ATTRIBUTES> CACHE_VALUE; typedef ACE_Hash_Map_Manager_Ex<KEY, CACHE_VALUE, HASH_KEY, COMPARE_KEYS, ACE_Null_Mutex> HASH_MAP; typedef ACE_Hash_Map_Entry<KEY, CACHE_VALUE> CACHE_ENTRY; typedef KEY key_type; typedef VALUE mapped_type; ACE_Hash_Cache_Map_Manager ( CACHING_STRATEGY &caching_s, size_t size = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0 ); ~ACE_Hash_Cache_Map_Manager (void); int bind (const KEY &key, const VALUE &value); int bind ( const KEY &key, const VALUE &value, CACHE_ENTRY *&entry ); int find (const KEY &key, VALUE &value); int find (const KEY &key); int find (const KEY &key, CACHE_ENTRY *&entry); int rebind (const KEY &key, const VALUE &value); int rebind (const KEY &key, const VALUE &value, VALUE &old_value); int rebind ( const KEY &key, const VALUE &value, KEY &old_key, VALUE &old_value ); int rebind ( const KEY &key, const VALUE &value, CACHE_ENTRY *&entry ); int trybind (const KEY &key, VALUE &value); int trybind (const KEY &key, VALUE &value, CACHE_ENTRY *&entry); int unbind (const KEY &key); int unbind (const KEY &key, VALUE &value); int unbind (CACHE_ENTRY *entry); protected: typedef ACE_CACHE_MAP_MANAGER ACE_HCMM_BASE; };

DESCRIPTION

The Hash_Cache_Map_Manager will manage the map it contains and provide purging on demand from the map. The strategy for caching is decided by the user and provided to the Cache Manager. The Cache Manager acts as a agent and communicates between the Map and the Strategy for purging entries from the map. To tap the optimal methods like find(key,value,entry) present in the ACE_Hash_Map_Manager, Hash_Cache_Map_Manager provides extra functionality on top of the Cache_Map_Manager.

No locking mechanism provided since locking at this level isnt efficient. Locking has to be provided by the application.

Initialization and termination methods.

ACE_Hash_Cache_Map_Manager (
    CACHING_STRATEGY &caching_s,
    size_t size = ACE_DEFAULT_MAP_SIZE,
    ACE_Allocator *alloc = 0
    );

~ACE_Hash_Cache_Map_Manager (void);

int bind (const KEY &key, const VALUE &value);

int bind (const KEY &key, const VALUE &value, CACHE_ENTRY *&entry);

int find (const KEY &key, VALUE &value);

int find (const KEY &key);

int find (const KEY &key, CACHE_ENTRY *&entry);

int rebind (const KEY &key, const VALUE &value);

int rebind (const KEY &key, const VALUE &value, VALUE &old_value);

int rebind (
    const KEY &key,
    const VALUE &value,
    KEY &old_key,
    VALUE &old_value
    );

int rebind (const KEY &key, const VALUE &value, CACHE_ENTRY *&entry);

int trybind (const KEY &key, VALUE &value);

int trybind (const KEY &key, VALUE &value, CACHE_ENTRY *&entry);

int unbind (const KEY &key);

int unbind (const KEY &key, VALUE &value);

int unbind (CACHE_ENTRY *entry);

AUTHOR

Kirthika Parameswaran kirthika@cs.wustl.edu

LIBRARY

ace