CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BigQueue< Item > Class Template Reference

#include <bigqueue.h>

Inheritance diagram for BigQueue< Item >:
Collaboration diagram for BigQueue< Item >:

Public Member Functions

 BigQueue ()
 
 BigQueue (const size_t num_items)
 
 BigQueue (const BigQueue< Item > &other)
 
BigQueue< Item > & operator= (const BigQueue< Item > &other)
 
 ~BigQueue ()
 
void PushBack (const Item &item)
 
void PopFront ()
 
bool Peek (Item **item)
 
bool IsEmpty () const
 
void Clear ()
 
size_t size () const
 
size_t capacity () const
 

Private Member Functions

size_t GetHeadOffset () const
 
size_t GetAvailableSpace () const
 
void Alloc (const size_t num_elements)
 
void Dealloc ()
 
void Migrate (size_t new_capacity)
 
void FreeBuffer (Item *buf, const size_t nitems)
 
void CopyFrom (const BigQueue< Item > &other)
 

Private Attributes

Item * buffer_
 
Item * head_
 
size_t size_
 
size_t capacity_
 

Static Private Attributes

static const size_t kNumInit = 64
 
static const size_t kCompactThreshold = 64
 

Detailed Description

template<class Item>
class BigQueue< Item >

This file is part of the CernVM File System.

Similar to bigvector, but queue semantics. Used by the negative entry tracker. Allocates with mmap in order to avoid memory fragmentation.

Definition at line 19 of file bigqueue.h.

Constructor & Destructor Documentation

template<class Item>
BigQueue< Item >::BigQueue ( )
inline

Definition at line 21 of file bigqueue.h.

template<class Item>
BigQueue< Item >::BigQueue ( const size_t  num_items)
inlineexplicit

Definition at line 26 of file bigqueue.h.

template<class Item>
BigQueue< Item >::BigQueue ( const BigQueue< Item > &  other)
inline

Definition at line 32 of file bigqueue.h.

template<class Item>
BigQueue< Item >::~BigQueue ( )
inline

Definition at line 45 of file bigqueue.h.

Member Function Documentation

template<class Item>
void BigQueue< Item >::Alloc ( const size_t  num_elements)
inlineprivate
template<class Item>
size_t BigQueue< Item >::capacity ( ) const
inline

Definition at line 83 of file bigqueue.h.

template<class Item>
void BigQueue< Item >::Clear ( )
inline

Definition at line 77 of file bigqueue.h.

template<class Item>
void BigQueue< Item >::CopyFrom ( const BigQueue< Item > &  other)
inlineprivate

Definition at line 131 of file bigqueue.h.

Referenced by BigQueue< glue::DentryTracker::Entry >::BigQueue(), and BigQueue< glue::DentryTracker::Entry >::operator=().

Here is the caller graph for this function:

template<class Item>
void BigQueue< Item >::Dealloc ( )
inlineprivate
template<class Item>
void BigQueue< Item >::FreeBuffer ( Item *  buf,
const size_t  nitems 
)
inlineprivate

Definition at line 123 of file bigqueue.h.

Referenced by BigQueue< glue::DentryTracker::Entry >::Dealloc(), and BigQueue< glue::DentryTracker::Entry >::Migrate().

Here is the caller graph for this function:

template<class Item>
size_t BigQueue< Item >::GetAvailableSpace ( ) const
inlineprivate

Definition at line 90 of file bigqueue.h.

Referenced by BigQueue< glue::DentryTracker::Entry >::PushBack().

Here is the caller graph for this function:

template<class Item>
size_t BigQueue< Item >::GetHeadOffset ( ) const
inlineprivate
template<class Item>
bool BigQueue< Item >::IsEmpty ( ) const
inline

Definition at line 73 of file bigqueue.h.

Referenced by BigQueue< glue::DentryTracker::Entry >::Peek(), and BigQueue< glue::DentryTracker::Entry >::PopFront().

Here is the caller graph for this function:

template<class Item>
void BigQueue< Item >::Migrate ( size_t  new_capacity)
inlineprivate

Definition at line 109 of file bigqueue.h.

Referenced by BigQueue< glue::DentryTracker::Entry >::PopFront(), and BigQueue< glue::DentryTracker::Entry >::PushBack().

Here is the caller graph for this function:

template<class Item>
BigQueue<Item>& BigQueue< Item >::operator= ( const BigQueue< Item > &  other)
inline

Definition at line 36 of file bigqueue.h.

template<class Item>
bool BigQueue< Item >::Peek ( Item **  item)
inline

Definition at line 66 of file bigqueue.h.

template<class Item>
void BigQueue< Item >::PopFront ( )
inline

Definition at line 58 of file bigqueue.h.

template<class Item>
void BigQueue< Item >::PushBack ( const Item &  item)
inline

Definition at line 49 of file bigqueue.h.

template<class Item>
size_t BigQueue< Item >::size ( ) const
inline

Definition at line 82 of file bigqueue.h.

Member Data Documentation

template<class Item>
const size_t BigQueue< Item >::kCompactThreshold = 64
staticprivate

Definition at line 87 of file bigqueue.h.

Referenced by BigQueue< glue::DentryTracker::Entry >::PopFront().

template<class Item>
const size_t BigQueue< Item >::kNumInit = 64
staticprivate

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