Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

SPKFile Class Reference

#include <SPKFile.H>

Inheritance diagram for SPKFile:

VPKFile List of all members.

Public Types

typedef Table< FP::Tag, CE::List
* >::Default 
CFPEntryMap
typedef Table< FP::Tag, CE::List
* >::Iterator 
CFPEntryIter

Public Member Functions

 SPKFile (const FP::Tag &pk) throw ()
 SPKFile (const FP::Tag &pk, std::ifstream &ifs, std::streampos origin, int version, SPKFileRep::Header *&hdr, bool readEntries=true, bool readImmutable=true) throw (FS::EndOfFile, FS::Failure)
bool Update (const VPKFileChkPt *chkpt, const BitVector *toDelete, BitVector *&exCommonNames, BitVector *&exUncommonNames, BitVector *&packMask, IntIntTblLR *&reMap, bool &isEmpty) throw ()
void Read (std::ifstream &ifs, std::streampos origin, int version, SPKFileRep::Header *&hdr, bool readEntries=true, bool readImmutable=true) throw (FS::EndOfFile, FS::Failure)
void Write (std::ifstream &ifs, std::ostream &ofs, std::streampos origin, SPKFileRep::Header *&hdr) const throw (FS::Failure)
void Debug (std::ostream &os, const SPKFileRep::Header &hdr, std::streampos origin, bool verbose=false) const throw ()
const FP::Tag PK () const throw ()
PKFile::Epoch PKEpoch () const throw ()
FV::Epoch NamesEpoch () const throw ()
const FV::ListAppAllNames () const throw ()
const BitVectorCommonNames () const throw ()
const CFPEntryMapOldEntries () const throw ()
const TextSourceFunc () const throw ()

Protected Member Functions

void AddEntryToTable (CFPEntryMap &tbl, const FP::Tag &cfp, CE::T *ce) const throw ()
virtual VPKFileChkPtCheckPoint () throw ()
void ScanCommonTable (const CFPEntryMap &cfpTbl, const BitVector *toDelete, BitVector &uncommonJoin, BitVector &uncommonMeet, int &totalEntries, bool &delOne) const throw ()
void ScanList (const CE::List *head, const BitVector *toDelete, BitVector &uncommonJoin, BitVector &uncommonMeet, int &totalEntries, bool &delOne) const throw ()
CE::ListExtractEntries (CFPEntryMap &cfpTbl) throw ()
void UpdateCommonTable (CFPEntryMap &cfpTbl, const BitVector *toDelete, const BitVector *exCommonNames, const BitVector *exUncommonNames, const BitVector *packMask, const IntIntTblLR *reMap, bool unlazyTag=true) throw ()

Static Protected Member Functions

static CE::TLookup (std::ifstream &ifs, std::streampos origin, int version, const FP::Tag &commonTag, const FP::List &fps) throw (FS::EndOfFile, FS::Failure)

Protected Attributes

FP::Tag pk
PKFile::Epoch pkEpoch
FV::Epoch namesEpoch
FV::ListApp allNames
BitVector commonNames
CFPEntryMap oldEntries
const TextsourceFunc

Private Member Functions

void AddEntries (const VPKFileChkPt &chkpt, const BitVector *toDelete, const BitVector *exCommonNames, const BitVector *exUncommonNames, const BitVector *packMask, const IntIntTblLR *reMap, bool unlazyTag) throw ()
void UpdateList (CFPEntryMap &cfpTbl, const CE::List *ents, const BitVector *toDelete, const BitVector *exCommonNames, const BitVector *exUncommonNames, const BitVector *packMask, const IntIntTblLR *reMap, bool unlazyTag) throw ()
CE::ListReadEntries (std::ifstream &ifs, bool readImmutable=true) throw (FS::EndOfFile, FS::Failure)
void WriteEntries (std::ifstream &ifs, std::ostream &ofs, CE::List *entryList) const throw (FS::Failure)

Static Private Member Functions

static std::streampos LookupCFP (std::ifstream &ifs, std::streampos origin, int version, const FP::Tag &cfp, const SPKFileRep::Header &hdr) throw (FS::EndOfFile, FS::Failure)
static std::streampos LookupCFPInListV1 (std::ifstream &ifs, std::streampos origin, const FP::Tag &cfp, int num) throw (FS::EndOfFile, FS::Failure)
static std::streampos LookupCFPInSortedListV1 (std::ifstream &ifs, std::streampos origin, const FP::Tag &cfp, int num) throw (FS::EndOfFile, FS::Failure)
static CE::TLookupEntryV1 (std::ifstream &ifs, const FP::List &fps) throw (FS::EndOfFile, FS::Failure)

Member Typedef Documentation

typedef Table<FP::Tag,CE::List*>::Iterator SPKFile::CFPEntryIter
 

Definition at line 186 of file SPKFile.H.

typedef Table<FP::Tag,CE::List*>::Default SPKFile::CFPEntryMap
 

Definition at line 185 of file SPKFile.H.


Constructor & Destructor Documentation

SPKFile::SPKFile const FP::Tag pk  )  throw () [inline]
 

Definition at line 42 of file SPKFile.H.

SPKFile::SPKFile const FP::Tag pk,
std::ifstream &  ifs,
std::streampos  origin,
int  version,
SPKFileRep::Header *&  hdr,
bool  readEntries = true,
bool  readImmutable = true
throw (FS::EndOfFile, FS::Failure) [inline]
 

Definition at line 47 of file SPKFile.H.

References Read().


Member Function Documentation

void SPKFile::AddEntries const VPKFileChkPt chkpt,
const BitVector toDelete,
const BitVector exCommonNames,
const BitVector exUncommonNames,
const BitVector packMask,
const IntIntTblLR reMap,
bool  unlazyTag
throw () [private]
 

Definition at line 372 of file SPKFile.C.

References Table< K, V >::Iterator::Next().

void SPKFile::AddEntryToTable CFPEntryMap tbl,
const FP::Tag cfp,
CE::T ce
const throw () [protected]
 

Definition at line 431 of file SPKFile.C.

References NEW_CONSTR.

const FV::ListApp* SPKFile::AllNames  )  const throw () [inline]
 

Definition at line 195 of file SPKFile.H.

References allNames.

VPKFileChkPt * SPKFile::CheckPoint  )  throw () [protected, virtual]
 

!const

Reimplemented in VPKFile.

Definition at line 283 of file SPKFile.C.

References VPKFileChkPt::allNames, allNames, VPKFileChkPt::allNamesLen, FV::List::len, namesEpoch, VPKFileChkPt::namesEpoch, NEW, pkEpoch, VPKFileChkPt::pkEpoch, sourceFunc, and VPKFileChkPt::sourceFunc.

Referenced by VPKFile::CheckPoint().

const BitVector* SPKFile::CommonNames  )  const throw () [inline]
 

Definition at line 197 of file SPKFile.H.

References commonNames.

Referenced by SMultiPKFile::Rewrite().

void SPKFile::Debug std::ostream &  os,
const SPKFileRep::Header hdr,
std::streampos  origin,
bool  verbose = false
const throw ()
 

Definition at line 787 of file SPKFile.C.

References CE::List::Head(), CE::List::Length(), CE::List::Tail(), and verbose.

CE::List * SPKFile::ExtractEntries CFPEntryMap cfpTbl  )  throw () [protected]
 

Definition at line 335 of file SPKFile.C.

References NEW_CONSTR, and Table< K, V >::Iterator::Next().

CE::T * SPKFile::Lookup std::ifstream &  ifs,
std::streampos  origin,
int  version,
const FP::Tag commonTag,
const FP::List fps
throw (FS::EndOfFile, FS::Failure) [static, protected]
 

Definition at line 445 of file SPKFile.C.

References FS::Posn(), FS::Seek(), SPKFileRep::SourceFuncVersion, and VestaSourceSRPC::version.

Referenced by VPKFile::Lookup().

streampos SPKFile::LookupCFP std::ifstream &  ifs,
std::streampos  origin,
int  version,
const FP::Tag cfp,
const SPKFileRep::Header hdr
throw (FS::EndOfFile, FS::Failure) [static, private]
 

Definition at line 473 of file SPKFile.C.

References SPKFileRep::HT_HashTable, SPKFileRep::HT_List, SPKFileRep::HT_PerfectHashTable, SPKFileRep::HT_SortedList, SPKFileRep::SourceFuncVersion, and VestaSourceSRPC::version.

streampos SPKFile::LookupCFPInListV1 std::ifstream &  ifs,
std::streampos  origin,
const FP::Tag cfp,
int  num
throw (FS::EndOfFile, FS::Failure) [static, private]
 

Definition at line 507 of file SPKFile.C.

References SPKFileRep::HeaderEntry::cfp, and SPKFileRep::HeaderEntry::offset.

streampos SPKFile::LookupCFPInSortedListV1 std::ifstream &  ifs,
std::streampos  origin,
const FP::Tag cfp,
int  num
throw (FS::EndOfFile, FS::Failure) [static, private]
 

Definition at line 522 of file SPKFile.C.

References SPKFileRep::HeaderEntry::cfp, Compare(), SPKFileRep::HeaderEntry::offset, FS::Posn(), FS::Seek(), and SPKFileRep::HeaderEntry::Size().

CE::T * SPKFile::LookupEntryV1 std::ifstream &  ifs,
const FP::List fps
throw (FS::EndOfFile, FS::Failure) [static, private]
 

Definition at line 557 of file SPKFile.C.

References CE::T::FPMatch(), NEW_CONSTR, FS::Read(), and CE::T::UncommonFPIsUnlazied().

FV::Epoch SPKFile::NamesEpoch  )  const throw () [inline]
 

Definition at line 193 of file SPKFile.H.

References namesEpoch.

Referenced by CacheS_DoFreeMPKFiles().

const CFPEntryMap* SPKFile::OldEntries  )  const throw () [inline]
 

Definition at line 199 of file SPKFile.H.

References oldEntries.

Referenced by CacheS_DoFreeMPKFiles().

const FP::Tag SPKFile::PK  )  const throw () [inline]
 

Definition at line 189 of file SPKFile.H.

References pk.

Referenced by PKFileObj::PKFileObj().

PKFile::Epoch SPKFile::PKEpoch  )  const throw () [inline]
 

Definition at line 191 of file SPKFile.H.

References pkEpoch.

Referenced by CacheS::AddEntry(), CacheS::PKFileEpoch(), and SMultiPKFile::Rewrite().

void SPKFile::Read std::ifstream &  ifs,
std::streampos  origin,
int  version,
SPKFileRep::Header *&  hdr,
bool  readEntries = true,
bool  readImmutable = true
throw (FS::EndOfFile, FS::Failure)
 

Definition at line 581 of file SPKFile.C.

References NEW, NEW_CONSTR, CompactFV::List::num, FS::Posn(), FS::Read(), TextIO::Read(), SPKFileRep::Header::Skip(), SPKFileRep::SourceFuncVersion, CompactFV::List::ToFVList(), and VestaSourceSRPC::version.

Referenced by SPKFile().

CE::List * SPKFile::ReadEntries std::ifstream &  ifs,
bool  readImmutable = true
throw (FS::EndOfFile, FS::Failure) [private]
 

Definition at line 633 of file SPKFile.C.

References NEW_CONSTR, FS::Read(), and CE::List::SetTail().

void SPKFile::ScanCommonTable const CFPEntryMap cfpTbl,
const BitVector toDelete,
BitVector uncommonJoin,
BitVector uncommonMeet,
int &  totalEntries,
bool &  delOne
const throw () [protected]
 

Definition at line 295 of file SPKFile.C.

References Table< K, V >::Iterator::Next().

void SPKFile::ScanList const CE::List head,
const BitVector toDelete,
BitVector uncommonJoin,
BitVector uncommonMeet,
int &  totalEntries,
bool &  delOne
const throw () [protected]
 

Definition at line 311 of file SPKFile.C.

References CE::T::CI(), and CE::T::UncommonNames().

const Text* SPKFile::SourceFunc  )  const throw () [inline]
 

Definition at line 201 of file SPKFile.H.

References sourceFunc.

Referenced by PKFileObj::PKFileObj().

bool SPKFile::Update const VPKFileChkPt chkpt,
const BitVector toDelete,
BitVector *&  exCommonNames,
BitVector *&  exUncommonNames,
BitVector *&  packMask,
IntIntTblLR *&  reMap,
bool &  isEmpty
throw ()
 

Definition at line 45 of file SPKFile.C.

References BitVector::IsEmpty(), NEW, NEW_CONSTR, BVIter::Next(), BitVector::NextAvail(), BitVector::SetInterval(), and BitVector::Size().

Referenced by SMultiPKFile::Rewrite().

void SPKFile::UpdateCommonTable CFPEntryMap cfpTbl,
const BitVector toDelete,
const BitVector exCommonNames,
const BitVector exUncommonNames,
const BitVector packMask,
const IntIntTblLR reMap,
bool  unlazyTag = true
throw () [protected]
 

Definition at line 352 of file SPKFile.C.

void SPKFile::UpdateList CFPEntryMap cfpTbl,
const CE::List ents,
const BitVector toDelete,
const BitVector exCommonNames,
const BitVector exUncommonNames,
const BitVector packMask,
const IntIntTblLR reMap,
bool  unlazyTag
throw () [private]
 

Definition at line 404 of file SPKFile.C.

References CE::T::CI(), CE::T::CombineFP(), CE::T::UnlazyUncommonFP(), and CE::T::Update().

void SPKFile::Write std::ifstream &  ifs,
std::ostream &  ofs,
std::streampos  origin,
SPKFileRep::Header *&  hdr
const throw (FS::Failure)
 

Definition at line 666 of file SPKFile.C.

References SPKFileRep::HeaderEntry::cfp, Debug::Lock(), NEW, NEW_ARRAY, Table< K, V >::Iterator::Next(), SPKFileRep::HeaderEntry::offset, FS::Posn(), Debug::Timestamp(), Debug::Unlock(), CompactFV::List::Write(), FS::Write(), TextIO::Write(), and FP::Tag::Write().

Referenced by SMultiPKFile::Rewrite().

void SPKFile::WriteEntries std::ifstream &  ifs,
std::ostream &  ofs,
CE::List entryList
const throw (FS::Failure) [private]
 

Definition at line 738 of file SPKFile.C.

References CE::List::Head(), CE::List::Length(), Debug::Lock(), CE::List::Tail(), Debug::Timestamp(), Debug::Unlock(), and FS::Write().


Member Data Documentation

FV::ListApp SPKFile::allNames [protected]
 

Definition at line 209 of file SPKFile.H.

Referenced by AllNames(), and CheckPoint().

BitVector SPKFile::commonNames [protected]
 

Definition at line 210 of file SPKFile.H.

Referenced by VPKFile::CommonFP(), CommonNames(), and VPKFile::IsCommon().

FV::Epoch SPKFile::namesEpoch [protected]
 

Definition at line 208 of file SPKFile.H.

Referenced by CheckPoint(), and NamesEpoch().

CFPEntryMap SPKFile::oldEntries [protected]
 

Definition at line 211 of file SPKFile.H.

Referenced by VPKFile::IsEmpty(), and OldEntries().

FP::Tag SPKFile::pk [protected]
 

Definition at line 206 of file SPKFile.H.

Referenced by PK().

PKFile::Epoch SPKFile::pkEpoch [protected]
 

Definition at line 207 of file SPKFile.H.

Referenced by VPKFile::CheckPoint(), CheckPoint(), VPKFile::DecrPKEpoch(), and PKEpoch().

const Text* SPKFile::sourceFunc [protected]
 

Definition at line 212 of file SPKFile.H.

Referenced by CheckPoint(), and SourceFunc().


The documentation for this class was generated from the following files:
Generated on Mon May 8 00:49:13 2006 for Vesta by  doxygen 1.4.2