Coda Distributed File System
Public Member Functions | List of all members
bitmap7 Class Reference

#include <bitmap7.h>

Public Member Functions

void * operator new (size_t size, int recable=0) TRANSACTION_OPTIONAL
 
void operator delete (void *ptr) TRANSACTION_OPTIONAL
 
 bitmap7 (int inputmapsize=0, int recable=0)
 
 ~bitmap7 ()
 
void Resize (int newsize) TRANSACTION_OPTIONAL
 
void Grow (int newsize)
 
int GetFreeIndex () TRANSACTION_OPTIONAL
 
void FreeIndex (int index)
 
void FreeRange (int start, int len)
 
void SetIndex (int index) TRANSACTION_OPTIONAL
 
void SetRange (int start, int len)
 
void CopyRange (int start, int len, bitmap7 &b) TRANSACTION_OPTIONAL
 
int Value (int index)
 
int Count ()
 
int Size ()
 
void purge () TRANSACTION_OPTIONAL
 
void operator= (bitmap7 &b) TRANSACTION_OPTIONAL
 
int operator!= (bitmap7 &b)
 
void print ()
 
void print (FILE *fp)
 
void print (int fd)
 

Constructor & Destructor Documentation

◆ bitmap7()

bitmap7::bitmap7 ( int  inputmapsize = 0,
int  recable = 0 
)

Constructor

Parameters
inputmapsizesize of the bitmap being created
recablerecoverable flag (RVM persistent)

◆ ~bitmap7()

bitmap7::~bitmap7 ( )

Destructor

Member Function Documentation

◆ CopyRange()

void bitmap7::CopyRange ( int  start,
int  len,
bitmap7 b 
)

Copy a range from one bitmap to another

Parameters
startstart of the range
lenlength of the range
boutput bitmap

◆ Count()

int bitmap7::Count ( )

Count the number of 1's in the bitmap

Returns
number of bits set to 1

◆ FreeIndex()

void bitmap7::FreeIndex ( int  index)

Unset the bit at a particular index

Parameters
indexindex of the bit to be unset

◆ FreeRange()

void bitmap7::FreeRange ( int  start,
int  len 
)

Unset all the bits at a particular range

Parameters
startstart of the range
lenlength of the range

◆ GetFreeIndex()

int bitmap7::GetFreeIndex ( )

Get an index that is not in use and mark it

Returns
index obtained

◆ Grow()

void bitmap7::Grow ( int  newsize)

Grow the bitmap to a new size

Parameters
newsizebitmap's new size

◆ operator delete()

void bitmap7::operator delete ( void *  ptr)

Delete operator overloading

Parameters
ptrPointer of the object to be deleted

◆ operator new()

void * bitmap7::operator new ( size_t  size,
int  recable = 0 
)

New operator overloading

Parameters
sizememory size in bytes
recablerecoverable flag (RVM persistent)
Returns
pointer to the new allocated object

◆ operator!=()

int bitmap7::operator!= ( bitmap7 b)

Test for inequality

Parameters
binput bitmap
Returns
0 if both bitmaps are unequal and 1 otherwise

◆ operator=()

void bitmap7::operator= ( bitmap7 b)

Deep copy the entire bitmap

Parameters
binput bitmap

◆ print() [1/3]

void bitmap7::print ( void  )

Print the bitmap's content to stderr

◆ print() [2/3]

void bitmap7::print ( FILE *  fp)

Print the bitmap's content to a file

Parameters
fppointer to the file struct of the file to be written to

◆ print() [3/3]

void bitmap7::print ( int  fd)

Print the bitmap's content to a file given a file descriptor

Parameters
fdfile descriptor of the file to be written to

◆ purge()

void bitmap7::purge ( )

Delete the map

◆ Resize()

void bitmap7::Resize ( int  newsize)

Resize the bitmap to a new size

Parameters
newsizebitmap's new size

◆ SetIndex()

void bitmap7::SetIndex ( int  index)

Set the bit at a particular index

Parameters
indexindex of the bit to be set

◆ SetRange()

void bitmap7::SetRange ( int  start,
int  len 
)

Set all the bits at a particular range

Parameters
startstart of the range
lenlength of the range

◆ Size()

int bitmap7::Size ( )

Obtain the size of the bitmap

Returns
size of the bitmap

◆ Value()

int bitmap7::Value ( int  index)

Get the bit's value at a particular index

Parameters
indexindex of the bit to be read
Returns
bit's value

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