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

#include <bigvector.h>

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

Public Member Functions

 BigVector ()
 
 BigVector (const size_t num_items)
 
 BigVector (const BigVector< Item > &other)
 
BigVector< Item > & operator= (const BigVector< Item > &other)
 
 ~BigVector ()
 
Item At (const size_t index) const
 
const Item * AtPtr (const size_t index) const
 
void PushBack (const Item &item)
 
void Replace (size_t index, const Item &item)
 
bool IsEmpty () const
 
void Clear ()
 
void ShareBuffer (Item **duplicate, bool *large_alloc)
 
void DoubleCapacity ()
 
void ShrinkIfOversized ()
 
void SetSize (const size_t new_size)
 
size_t size () const
 
size_t capacity () const
 

Private Member Functions

Item * Alloc (const size_t num_elements)
 
void Dealloc ()
 
void FreeBuffer (Item *buf, const size_t size, const bool large)
 
void CopyFrom (const BigVector< Item > &other)
 

Private Attributes

Item * buffer_
 
size_t size_
 
size_t capacity_
 
bool large_alloc_
 
bool shared_buffer_
 

Static Private Attributes

static const size_t kNumInit = 16
 
static const size_t kMmapThreshold = 128*1024
 

Detailed Description

template<class Item>
class BigVector< Item >

This file is part of the CernVM File System.

Dynamic array, allocate with mmap for large arrays.

Definition at line 16 of file bigvector.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file bigvector.h.

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

Definition at line 24 of file bigvector.h.

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

Definition at line 31 of file bigvector.h.

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

Definition at line 45 of file bigvector.h.

Member Function Documentation

template<class Item>
Item* BigVector< Item >::Alloc ( const size_t  num_elements)
inlineprivate
template<class Item>
size_t BigVector< Item >::capacity ( ) const
inline

Definition at line 122 of file bigvector.h.

Referenced by cvmfs::AddToDirListing().

Here is the caller graph for this function:

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

Definition at line 76 of file bigvector.h.

Referenced by FuseInvalidator::MainInvalidator().

Here is the caller graph for this function:

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

Definition at line 162 of file bigvector.h.

Referenced by BigVector< uint64_t >::BigVector(), and BigVector< uint64_t >::operator=().

Here is the caller graph for this function:

template<class Item>
void BigVector< Item >::Dealloc ( )
inlineprivate

Definition at line 142 of file bigvector.h.

Referenced by BigVector< uint64_t >::Clear(), BigVector< uint64_t >::operator=(), and BigVector< uint64_t >::~BigVector().

Here is the caller graph for this function:

template<class Item>
void BigVector< Item >::DoubleCapacity ( )
inline

Definition at line 87 of file bigvector.h.

Referenced by cvmfs::AddToDirListing(), and BigVector< uint64_t >::PushBack().

Here is the caller graph for this function:

template<class Item>
void BigVector< Item >::FreeBuffer ( Item *  buf,
const size_t  size,
const bool  large 
)
inlineprivate

Definition at line 149 of file bigvector.h.

Referenced by BigVector< uint64_t >::Dealloc(), BigVector< uint64_t >::DoubleCapacity(), and BigVector< uint64_t >::ShrinkIfOversized().

Here is the caller graph for this function:

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

Definition at line 35 of file bigvector.h.

template<class Item>
void BigVector< Item >::Replace ( size_t  index,
const Item &  item 
)
inline

Definition at line 67 of file bigvector.h.

Referenced by glue::StatStore::Erase().

Here is the caller graph for this function:

template<class Item>
void BigVector< Item >::SetSize ( const size_t  new_size)
inline

Definition at line 116 of file bigvector.h.

Referenced by cvmfs::AddToDirListing(), and glue::StatStore::Erase().

Here is the caller graph for this function:

template<class Item>
void BigVector< Item >::ShareBuffer ( Item **  duplicate,
bool *  large_alloc 
)
inline

Definition at line 81 of file bigvector.h.

Referenced by cvmfs::AddToDirListing().

Here is the caller graph for this function:

template<class Item>
void BigVector< Item >::ShrinkIfOversized ( )
inline

Definition at line 99 of file bigvector.h.

Referenced by glue::StatStore::Erase().

Here is the caller graph for this function:

Member Data Documentation

template<class Item>
const size_t BigVector< Item >::kMmapThreshold = 128*1024
staticprivate

Definition at line 126 of file bigvector.h.

Referenced by BigVector< uint64_t >::Alloc().

template<class Item>
const size_t BigVector< Item >::kNumInit = 16
staticprivate

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