CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
compat::inode_tracker_v2::SmallHashDynamic< Key, Value > Class Template Reference

#include <compat.h>

Inheritance diagram for compat::inode_tracker_v2::SmallHashDynamic< Key, Value >:
Collaboration diagram for compat::inode_tracker_v2::SmallHashDynamic< Key, Value >:

Public Types

typedef SmallHashBase< Key,
Value, SmallHashDynamic< Key,
Value > > 
Base
 

Public Member Functions

 SmallHashDynamic ()
 
 SmallHashDynamic (const SmallHashDynamic< Key, Value > &other)
 
SmallHashDynamic< Key, Value > & operator= (const SmallHashDynamic< Key, Value > &other)
 
uint32_t capacity () const
 
uint32_t size () const
 
uint32_t num_migrates () const
 
- Public Member Functions inherited from compat::inode_tracker_v2::SmallHashBase< Key, Value, SmallHashDynamic< Key, Value > >
 SmallHashBase ()
 
 ~SmallHashBase ()
 
void Init (uint32_t expected_size, Key empty, uint32_t(*hasher)(const Key &key))
 
bool Lookup (const Key &key, Value *value) const
 
bool Contains (const Key &key) const
 
void Insert (const Key &key, const Value &value)
 
void Erase (const Key &key)
 
void Clear ()
 
uint64_t bytes_allocated () const
 
void GetCollisionStats (uint64_t *num_collisions, uint32_t *max_collisions) const
 
uint32_t ScaleHash (const Key &key) const
 
void InitMemory ()
 
bool DoInsert (const Key &key, const Value &value, const bool count_collisions)
 
bool DoLookup (const Key &key, uint32_t *bucket, uint32_t *collisions) const
 
void DoClear (const bool reset_capacity)
 
void SetThresholds ()
 
void Grow ()
 
void Shrink ()
 
void ResetCapacity ()
 

Static Public Attributes

static const double kThresholdGrow
 
static const double kThresholdShrink
 
- Static Public Attributes inherited from compat::inode_tracker_v2::SmallHashBase< Key, Value, SmallHashDynamic< Key, Value > >
static const double kLoadFactor
 
static const double kThresholdGrow
 
static const double kThresholdShrink
 

Protected Member Functions

void SetThresholds ()
 
void Grow ()
 
void Shrink ()
 
void ResetCapacity ()
 

Private Member Functions

void Migrate (const uint32_t new_capacity)
 
void CopyFrom (const SmallHashDynamic< Key, Value > &other)
 

Private Attributes

uint32_t num_migrates_
 
uint32_t threshold_grow_
 
uint32_t threshold_shrink_
 

Friends

class SmallHashBase< Key, Value, SmallHashDynamic< Key, Value > >
 

Additional Inherited Members

- Static Public Member Functions inherited from compat::inode_tracker_v2::SmallHashBase< Key, Value, SmallHashDynamic< Key, Value > >
static double GetEntrySize ()
 
- Public Attributes inherited from compat::inode_tracker_v2::SmallHashBase< Key, Value, SmallHashDynamic< Key, Value > >
Key * keys_
 
Value * values_
 
uint32_t capacity_
 
uint32_t initial_capacity_
 
uint32_t size_
 
uint32_t(* hasher_ )(const Key &key)
 
uint64_t bytes_allocated_
 
uint64_t num_collisions_
 
uint32_t max_collisions_
 
Key empty_key_
 

Detailed Description

template<class Key, class Value>
class compat::inode_tracker_v2::SmallHashDynamic< Key, Value >

Definition at line 416 of file compat.h.

Member Typedef Documentation

template<class Key, class Value>
typedef SmallHashBase< Key, Value, SmallHashDynamic<Key, Value> > compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::Base

Definition at line 421 of file compat.h.

Constructor & Destructor Documentation

template<class Key, class Value>
compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::SmallHashDynamic ( )
inline

Definition at line 425 of file compat.h.

template<class Key, class Value>
compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::SmallHashDynamic ( const SmallHashDynamic< Key, Value > &  other)
inlineexplicit

Definition at line 428 of file compat.h.

Member Function Documentation

template<class Key, class Value>
uint32_t compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::capacity ( ) const
inline

Definition at line 438 of file compat.h.

template<class Key, class Value>
void compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::CopyFrom ( const SmallHashDynamic< Key, Value > &  other)
inlineprivate

Definition at line 453 of file compat.h.

template<class Key, class Value>
void compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::Grow ( )
inlineprotected

Definition at line 445 of file compat.h.

template<class Key, class Value>
void compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::Migrate ( const uint32_t  new_capacity)
inlineprivate

Definition at line 450 of file compat.h.

template<class Key, class Value>
uint32_t compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::num_migrates ( ) const
inline

Definition at line 440 of file compat.h.

template<class Key, class Value>
SmallHashDynamic<Key, Value>& compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::operator= ( const SmallHashDynamic< Key, Value > &  other)
inline

Definition at line 432 of file compat.h.

template<class Key, class Value>
void compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::ResetCapacity ( )
inlineprotected

Definition at line 447 of file compat.h.

template<class Key, class Value>
void compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::SetThresholds ( )
inlineprotected

Definition at line 442 of file compat.h.

template<class Key, class Value>
void compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::Shrink ( )
inlineprotected

Definition at line 446 of file compat.h.

template<class Key, class Value>
uint32_t compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::size ( ) const
inline

Definition at line 439 of file compat.h.

Friends And Related Function Documentation

template<class Key, class Value>
friend class SmallHashBase< Key, Value, SmallHashDynamic< Key, Value > >
friend

Definition at line 419 of file compat.h.

Member Data Documentation

template<class Key, class Value>
const double compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::kThresholdGrow
static

Definition at line 422 of file compat.h.

template<class Key, class Value>
const double compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::kThresholdShrink
static

Definition at line 423 of file compat.h.

template<class Key, class Value>
uint32_t compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::num_migrates_
private

Definition at line 456 of file compat.h.

template<class Key, class Value>
uint32_t compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::threshold_grow_
private

Definition at line 457 of file compat.h.

template<class Key, class Value>
uint32_t compat::inode_tracker_v2::SmallHashDynamic< Key, Value >::threshold_shrink_
private

Definition at line 458 of file compat.h.


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