apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

DynamicMMap Class Reference

#include <mmap.h>

Inheritance diagram for DynamicMMap:
[legend]
Collaboration diagram for DynamicMMap:
[legend]

Classes

struct  Pool
 

Public Member Functions

unsigned long RawAllocate (unsigned long long Size, unsigned long Aln=0)
 
unsigned long Allocate (unsigned long ItemSize)
 
unsigned long WriteString (const char *String, unsigned long Len=std::numeric_limits< unsigned long >::max())
 
unsigned long WriteString (const std::string &S)
 
void UsePools (Pool &P, unsigned int Count)
 
 DynamicMMap (FileFd &F, unsigned long Flags, unsigned long const &WorkSpace=2 *1024 *1024, unsigned long const &Grow=1024 *1024, unsigned long const &Limit=0)
 
 DynamicMMap (unsigned long Flags, unsigned long const &WorkSpace=2 *1024 *1024, unsigned long const &Grow=1024 *1024, unsigned long const &Limit=0)
 
virtual ~DynamicMMap ()
 
- Public Member Functions inherited from MMap
 operator void * ()
 
void * Data ()
 
unsigned long long Size ()
 
void AddSize (unsigned long long const size)
 
bool validData () const
 
bool Sync ()
 
bool Sync (unsigned long Start, unsigned long Stop)
 
 MMap (FileFd &F, unsigned long Flags)
 
 MMap (unsigned long Flags)
 
virtual ~MMap ()
 

Protected Member Functions

bool Grow ()
 
- Protected Member Functions inherited from MMap
bool Map (FileFd &Fd)
 
bool Close (bool DoSync=true)
 

Protected Attributes

FileFdFd
 
unsigned long WorkSpace
 
unsigned long const GrowFactor
 
unsigned long const Limit
 
PoolPools
 
unsigned int PoolCount
 
- Protected Attributes inherited from MMap
unsigned long Flags
 
unsigned long long iSize
 
void * Base
 
FileFdSyncToFd
 

Additional Inherited Members

- Public Types inherited from MMap
enum  OpenFlags {
  NoImmMap = (1<<0) , Public = (1<<1) , ReadOnly = (1<<2) , UnMapped = (1<<3) ,
  Moveable = (1<<4) , Fallback = (1 << 5)
}
 

Detailed Description

Definition at line 77 of file mmap.h.

Constructor & Destructor Documentation

◆ DynamicMMap() [1/2]

DynamicMMap ( FileFd F,
unsigned long  Flags,
unsigned long const &  WorkSpace = 2*1024*1024,
unsigned long const &  Grow = 1024*1024,
unsigned long const &  Limit = 0 
)

◆ DynamicMMap() [2/2]

DynamicMMap ( unsigned long  Flags,
unsigned long const &  WorkSpace = 2*1024*1024,
unsigned long const &  Grow = 1024*1024,
unsigned long const &  Limit = 0 
)

◆ ~DynamicMMap()

~DynamicMMap ( )
virtual

Definition at line 301 of file mmap.cc.

References MMap::Base, MMap::Close(), FileFd::Fd(), Fd, MMap::iSize, MMap::validData(), and WorkSpace.

Member Function Documentation

◆ Allocate()

unsigned long Allocate ( unsigned long  ItemSize)

Definition at line 350 of file mmap.cc.

References I, PoolCount, Pools, and RawAllocate().

Referenced by pkgCacheGenerator::AllocateInMap().

◆ Grow()

bool Grow ( )
protected

◆ RawAllocate()

unsigned long RawAllocate ( unsigned long long  Size,
unsigned long  Aln = 0 
)

Definition at line 325 of file mmap.cc.

References Grow(), MMap::iSize, MMap::Size(), and WorkSpace.

Referenced by Allocate(), pkgCacheGenerator::Start(), and WriteString().

◆ UsePools()

void UsePools ( Pool P,
unsigned int  Count 
)
inline

Definition at line 107 of file mmap.h.

References PoolCount, and Pools.

Referenced by pkgCacheGenerator::Start().

◆ WriteString() [1/2]

unsigned long WriteString ( const char *  String,
unsigned long  Len = std::numeric_limits<unsigned long>::max() 
)

Definition at line 414 of file mmap.cc.

References MMap::Base, and RawAllocate().

Referenced by pkgCacheGenerator::WriteStringInMap().

◆ WriteString() [2/2]

unsigned long WriteString ( const std::string &  S)
inline

Definition at line 106 of file mmap.h.

References WriteString().

Referenced by WriteString().

Member Data Documentation

◆ Fd

FileFd* Fd
protected

Definition at line 91 of file mmap.h.

Referenced by DynamicMMap(), Grow(), and ~DynamicMMap().

◆ GrowFactor

unsigned long const GrowFactor
protected

Definition at line 93 of file mmap.h.

Referenced by Grow().

◆ Limit

unsigned long const Limit
protected

Definition at line 94 of file mmap.h.

Referenced by Grow().

◆ PoolCount

unsigned int PoolCount
protected

Definition at line 96 of file mmap.h.

Referenced by Allocate(), and UsePools().

◆ Pools

Pool* Pools
protected

Definition at line 95 of file mmap.h.

Referenced by Allocate(), Grow(), and UsePools().

◆ WorkSpace

unsigned long WorkSpace
protected

Definition at line 92 of file mmap.h.

Referenced by DynamicMMap(), Grow(), RawAllocate(), and ~DynamicMMap().


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