OOFILE  1.9
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OOF_ExpandableLongArray Class Reference

Array of longs which expands automatically as you write to cells. More...

#include <oofarray.h>

Inheritance diagram for OOF_ExpandableLongArray:
Inheritance graph
[legend]

Public Member Functions

void append (unsigned long)
 
bool contains (unsigned long value) const
 
unsigned long count () const
 
unsigned long countOccurrences (unsigned long) const
 
void deleteAllCells (bool alwaysDeleteStorage=false)
 Effectively delete cells by resetting mNextFreeEntry cursor. More...
 
void deleteAllMatching (unsigned long value)
 
void deleteFirstMatching (unsigned long value)
 
void deleteItem (unsigned long index)
 
void describe (std::ostream &) const
 
bool find (unsigned long value, unsigned long &foundAt) const
 
unsigned long index () const
 
unsigned long & item (unsigned long index)
 
bool more () const
 
void next ()
 
 OOF_ExpandableLongArray (unsigned long defaultValue=0, unsigned long numSlots=0, unsigned int expandBySlots=4)
 
 OOF_ExpandableLongArray (const OOF_ExpandableLongArray &rhs)
 
unsigned long & operator() ()
 
OOF_ExpandableLongArrayoperator= (const OOF_ExpandableLongArray &)
 
unsigned long & operator[] (unsigned long index)
 
void start ()
 
unsigned long value (unsigned long index) const
 
virtual ~OOF_ExpandableLongArray ()
 

Protected Member Functions

void CopyBits (const OOF_ExpandableLongArray &rhs)
 
void DeleteBits ()
 
void ExpandToInclude (unsigned long indexToCover)
 
bool Invariant () const
 Guarantee members managing storage are consistent. More...
 

Protected Attributes

unsigned long * mBits
 
unsigned long mDefaultValue
 
unsigned int mExpansionChunk
 
unsigned long mInternalIter
 
unsigned long mNextFreeEntry
 
unsigned long mNumSlots
 

Detailed Description

Array of longs which expands automatically as you write to cells.

Definition at line 21 of file oofarray.h.

Constructor & Destructor Documentation

OOF_ExpandableLongArray::OOF_ExpandableLongArray ( unsigned long  defaultValue = 0,
unsigned long  numSlots = 0,
unsigned int  expandBySlots = 4 
)

Definition at line 26 of file oofarray.cpp.

References mBits, mExpansionChunk, and mNumSlots.

OOF_ExpandableLongArray::OOF_ExpandableLongArray ( const OOF_ExpandableLongArray rhs)

Definition at line 50 of file oofarray.cpp.

References CopyBits().

OOF_ExpandableLongArray::~OOF_ExpandableLongArray ( )
virtual

Definition at line 78 of file oofarray.cpp.

References DeleteBits().

Member Function Documentation

void OOF_ExpandableLongArray::append ( unsigned long  aBit)
bool OOF_ExpandableLongArray::contains ( unsigned long  value) const

Definition at line 174 of file oofarray.cpp.

References mNextFreeEntry, and value().

Referenced by OOF_ctreeKeywordIndex::indexesField().

void OOF_ExpandableLongArray::CopyBits ( const OOF_ExpandableLongArray rhs)
protected
unsigned long OOF_ExpandableLongArray::count ( ) const
inline

Definition at line 126 of file oofarray.h.

References mNextFreeEntry.

Referenced by oofDrawStyleArray::adopt(), OOF_simpleRecordBackend::AdoptBuffer(), dbHierBrowseHelper::appendLevel(), oofBroadcaster::askAllReturningAny(), oofBroadcaster::askAllStoppingAtFirst(), oofBroadcaster::broadcast(), oofRepTabStopSet::clear(), OOF_WordList::contains(), OOF_recordCache::containsContext(), OOF_recordCache::containsOffset(), oofMaskMultiStrings::copyChunk(), oofMaskMultiStrings::copyFinalChunk(), oofAdornerList::count(), oofDrawStyleArray::count(), OOF_recordCache::count(), oofRepTabStopList::count(), oofRepTabStopSet::count(), oofRepBandList::count(), oofRepBlockList::count(), oofRepBreakList::count(), oofRepMulti::count(), OOF_recordCache::countNew(), OOF_recordCache::countOccupied(), OOF_dbaseBackend::createTableInConnection(), dbHierBrowseHelper::deepestIndent(), oofRepPageList::deleteAll(), dbHierBrowseHelper::deleteAllLevels(), OOF_ramBackend::DeleteBlobBodies(), dbHierBrowseHelper::deleteContentsCache(), OOF_recordCache::deleteRecord(), OOF_ctreeBackend::deleteRecord(), describe(), OOF_simpleRecordBackend::DonateBlobBodiesTo(), oofRepMulti::draw(), oofRepPage::draw(), dbView::FinishCopy(), oofRepWinGUIPreviewMFC::getNumPages(), dbHierBrowseHelper::highlightedOID(), dbHierBrowseHelper::itemIsAtBottom(), dbHierBrowseHelper::lowestLevel(), OOF_dbaseBackend::OOF_dbaseBackend(), OOF_WordList::orphanStringArray(), OOF_simpleRecordBackend::ResetBlobs(), dbHierBrowseHelper::resetTableAfterViewRestructure(), OOF_ramBackend::SaveContext(), oofMaskMultiStrings::totalChunkLen(), dbView::~dbView(), OOF_InteractionPageAreas::~OOF_InteractionPageAreas(), OOF_recordBufferedContext::~OOF_recordBufferedContext(), OOF_recordCache::~OOF_recordCache(), OOF_WordList::~OOF_WordList(), oofDrawStyleArray::~oofDrawStyleArray(), oofMaskMultiStrings::~oofMaskMultiStrings(), oofRepMulti::~oofRepMulti(), oofRepPage::~oofRepPage(), and oofXMLwriter::~oofXMLwriter().

unsigned long OOF_ExpandableLongArray::countOccurrences ( unsigned long  schValue) const

Definition at line 201 of file oofarray.cpp.

References mNextFreeEntry, and value().

void OOF_ExpandableLongArray::deleteAllCells ( bool  alwaysDeleteStorage = false)

Effectively delete cells by resetting mNextFreeEntry cursor.

Parameters
alwaysDeleteStoragemeans unconditionally cleanup storage so can force total cleanup.
Todo:
delete mBits if past threshold

Definition at line 219 of file oofarray.cpp.

References DeleteBits(), Invariant(), and mNextFreeEntry.

Referenced by oofDrawStyleArray::adopt(), OOF_recordCache::deleteAll(), oofRepPageList::deleteAll(), dbHierBrowseHelper::deleteContentsCache(), oofIDfactory::reset(), and oofRepMulti::~oofRepMulti().

void OOF_ExpandableLongArray::deleteAllMatching ( unsigned long  value)

Definition at line 161 of file oofarray.cpp.

References deleteItem(), mNextFreeEntry, and value().

Referenced by oofBroadcaster::broadcast().

void OOF_ExpandableLongArray::DeleteBits ( )
protected

Definition at line 101 of file oofarray.cpp.

References mBits, and mNumSlots.

Referenced by CopyBits(), deleteAllCells(), and ~OOF_ExpandableLongArray().

void OOF_ExpandableLongArray::deleteFirstMatching ( unsigned long  value)

Definition at line 152 of file oofarray.cpp.

References deleteItem(), and find().

Referenced by oofBroadcaster::removeReceiver().

void OOF_ExpandableLongArray::deleteItem ( unsigned long  index)
void OOF_ExpandableLongArray::describe ( std::ostream &  ) const

Definition at line 86 of file oofarray.cpp.

References count(), and value().

Referenced by OOF_recordSelection::describeRecsRep().

void OOF_ExpandableLongArray::ExpandToInclude ( unsigned long  indexToCover)
protected
Todo:
platform-specific optimal copy for expansion

Definition at line 258 of file oofarray.cpp.

References mBits, mDefaultValue, mExpansionChunk, mNextFreeEntry, mNumSlots, and OOF_MEM_DEBUG_FORCE_POOL_CHECK.

Referenced by operator[]().

bool OOF_ExpandableLongArray::find ( unsigned long  value,
unsigned long &  foundAt 
) const
unsigned long OOF_ExpandableLongArray::index ( ) const
inline

Definition at line 133 of file oofarray.h.

References mInternalIter.

Referenced by operator[](), and value().

bool OOF_ExpandableLongArray::Invariant ( ) const
inlineprotected

Guarantee members managing storage are consistent.

Note: we assume a user may cause mInternalIter to go out of bounds.

Definition at line 119 of file oofarray.h.

References mBits, mNextFreeEntry, and mNumSlots.

Referenced by CopyBits(), and deleteAllCells().

unsigned long & OOF_ExpandableLongArray::item ( unsigned long  index)
inline
bool OOF_ExpandableLongArray::more ( ) const
inline
void OOF_ExpandableLongArray::next ( )
inline
unsigned long & OOF_ExpandableLongArray::operator() ( )
inline

Definition at line 161 of file oofarray.h.

References mInternalIter, and operator[]().

OOF_ExpandableLongArray & OOF_ExpandableLongArray::operator= ( const OOF_ExpandableLongArray rhs)
unsigned long & OOF_ExpandableLongArray::operator[] ( unsigned long  index)

Definition at line 228 of file oofarray.cpp.

References ExpandToInclude(), index(), mBits, mNextFreeEntry, mNumSlots, and OOF_MEM_DEBUG_FORCE_POOL_CHECK.

Referenced by item(), and operator()().

void OOF_ExpandableLongArray::start ( )
inline
unsigned long OOF_ExpandableLongArray::value ( unsigned long  index) const

Definition at line 243 of file oofarray.cpp.

References index(), mBits, mDefaultValue, and mNextFreeEntry.

Referenced by oofDrawStyleArray::adopt(), oofColSizer::alignment(), oofBroadcaster::askAllReturningAny(), oofBroadcaster::askAllStoppingAtFirst(), oofBroadcaster::broadcast(), oofColSizer::CalculateDefaultWidths(), oofViewFieldDefaultsColSizer::CalculateDefaultWidths(), oofColSizer::calculateWidths(), contains(), OOF_WordList::contains(), OOF_recordCache::containsContext(), OOF_recordCache::containsOffset(), oofMaskMultiStrings::copyChunk(), OOF_recordCache::countNew(), countOccurrences(), dbView::currentHeading(), deleteAllMatching(), dbHierBrowseHelper::deleteContentsCache(), describe(), oofRepPage::element(), oofXMLwriter::endElement(), find(), dbView::FinishCopy(), oofColSizer::fixedPercentage(), oofColSizer::fixedWidth(), dbHierBrowseHelper::getCachedContents(), dbView::getHeading(), dbHierBrowseHelper::initCacheRow(), oofDrawStyleArray::item(), OOF_recordCache::item(), dbHierBrowseHelper::level(), dbHierBrowseHelper::lowestLevel(), oofFileList::oofFileList(), oofRepMulti::orphanSection(), OOF_WordList::orphanStringArray(), oofRepPageList::page(), OOF_recordCache::reuseDeletedItem(), oofRepMulti::section(), dbHierBrowseHelper::setCachedContents(), dbView::setHeading(), oofXMLwriter::startElement(), oofXMLwriter::topLevelClosed(), oofMaskMultiStrings::totalChunkLen(), oofAdornerList::value(), oofRepTabStopList::value(), oofRepTabStopSet::value(), oofRepBandList::value(), oofRepBlockList::value(), oofRepBreakList::value(), dbView::~dbView(), OOF_InteractionPageAreas::~OOF_InteractionPageAreas(), OOF_WordList::~OOF_WordList(), oofDrawStyleArray::~oofDrawStyleArray(), oofMaskMultiStrings::~oofMaskMultiStrings(), and oofXMLwriter::~oofXMLwriter().

Member Data Documentation

unsigned long* OOF_ExpandableLongArray::mBits
protected
unsigned long OOF_ExpandableLongArray::mDefaultValue
protected

Definition at line 62 of file oofarray.h.

Referenced by deleteItem(), ExpandToInclude(), operator=(), and value().

unsigned int OOF_ExpandableLongArray::mExpansionChunk
protected

Definition at line 64 of file oofarray.h.

Referenced by ExpandToInclude(), OOF_ExpandableLongArray(), and operator=().

unsigned long OOF_ExpandableLongArray::mInternalIter
protected

Definition at line 63 of file oofarray.h.

Referenced by index(), more(), next(), operator()(), operator=(), and start().

unsigned long OOF_ExpandableLongArray::mNextFreeEntry
protected
unsigned long OOF_ExpandableLongArray::mNumSlots
protected

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