Tools.h++ Class Reference
Table Of Contents
- Tools.h++ 7.0 Class Reference
- Intoduction
- Class Hierarchy
- RWAuditStreamBuffer
- RWBag
- RWBagIterator
- RWBench
- RWBinaryTree
- RWBinaryTreeIterator
- RWbistream
- RWBitVec
- RWbostream
- RWBTree
- RWBTreeDictionary
- RWBTreeOnDisk
- RWBufferedPageHeap
- RWCacheManager
- RWCLIPstreambuf
- RWCollectable
- RWCollectableAssociation
- RWCollectableDate
- RWCollectableInt
- RWCollectableString
- RWCollectableTime
- RWCollection
- RWCRegexp
- RWCRExpr
- RWCString
- RWCSubString
- RWCTokenizer
- RWDate
- RWDDEstreambuf
- RWDiskPageHeap
- RWDlistCollectables
- RWDlistCollectablesIterator
- RWeistream
- RWeostream
- RWFactory
- RWFile
- RWFileManager
- RWGBitVec(size)
- RWGDlist(type)
- RWGDlistIterator(type)
- RWGOrderedVector(val)
- RWGQueue(type)
- RWGSlist(type)
- RWGSlistIterator(type)
- RWGSortedVector(val)
- RWGStack(type)
- RWGVector(val)
- RWHashDictionary
- RWHashDictionaryIterator
- rw_hashmap
- rw_hashmultimap
- rw_hashmultiset
- rw_hashset
- RWHashTable
- RWHashTableIterator
- RWIdentityDictionary
- RWIdentitySet
- RWInteger
- RWIterator
- RWLocale
- RWLocaleSnapshot
- RWModel
- RWModelClient
- RWOrdered
- RWOrderedIterator
- RWpistream
- RWpostream
- RWSequenceable
- RWSet
- RWSetIterator
- rw_slist
- RWSlistCollectables
- RWSlistCollectablesIterator
- RWSlistCollectablesQueue
- RWSlistCollectablesStack
- RWSortedVector
- RWTBitVec
- RWTime
- RWTimer
- RWTIsvDlist
- RWTIsvDlistIterator
- RWTIsvSlist
- RWTIsvSlistIterator
- RWTPtrDeque
- RWTPtrDlist
- RWTPtrDlistIterator
- RWTPtrHashDictionary
- RWTPtrHashDictionaryIterator
- RWTPtrHashMap
- RWTPtrHashMapIterator
- RWTPtrHashMultiMap
- RWTPtrHashMultiMapIterator
- RWTPtrHashSet
- RWTPtrHashMultiSetIterator
- RWTPtrHashSetIterator
- RWTPtrHashTable
- RWTPtrHashTableIterator
- RWTPtrMap
- RWTPtrMapIterator
- RWTPtrMultiMap
- RWTPtrMultiMapIterator
- RWTPtrMultiSet
- RWTPtrMultiSetIterator
- RWTPtrOrderedVector
- RWTPtrSet
- RWTPtrSetIterator
- RWTPtrSlist
- RWTPtrSlistIterator
- RWTPtrSortedDlist
- RWTPtrSortedDlistIterator
- RWTPtrSortedVector
- RWTPtrVector
- RWTQueue
- RWTStack
- RWTValDeque
- RWTValDlist
- RWTValDlistIterator
- RWTValHashDictionary
- RWTValHashDictionaryIterator
- RWTValHashMap
- RWTValHashMapIterator
- RWTValHashMultiMap
- RWTValHashMultiMapIterator
- RWTValHashMultiSet
- RWTValHashMultiSetIterator
- RWTValHashSet
- RWTValHashSetIterator
- RWTValHashTable
- RWTValHashTableIterator
- RWTValMap
- RWTValMapIterator
- RWTValMultiMap
- RWTValMultiMapIterator
- RWTValMultiSet
- RWTValMultiSetIterator
- RWTValOrderedVector
- RWTValSet
- RWTValSetIterator
- RWTValSlist
- RWTValSlistIterator
- RWTValSortedDlist
- RWTValSortedDlistIterator
- RWTValSortedVector
- RWTValVector
- RWTValVirtualArray
- RWVirtualPageHeap
- RWvios
- RWvistream
- RWvostream
- RWWString
- RWWSubString
- RWWTokenizer
- RWXDRistream (Unix only)
- RWXDRostream (Unix only)
- RWZone
- RWZoneSimple
- Tools.h++ 7.0 Class Reference Appendix
- RWTPtrDlist
- RWTPtrDlistIterator
- RWTPtrHashDictionary
- RWTPtrHashDictionaryIterator
- RWTPtrHashSet
- RWTPtrHashTable
- RWTPtrHashTableIterator
- RWTPtrOrderedVector
- RWTPtrSlist
- RWTPtrSlistIterator
- RWTPtrSortedVector
- RWTValDlist
- RWTValDlistIterator
- RWTValHashDictionary
- RWTValHashDictionaryIterator
- RWTValHashSet
- RWTValHashTable
- RWTValHashTableIterator
- RWTValOrderedVector
- RWTValSlist
- RWTValSlistIterator
- RWTValSortedVector
- RWTPtrDlist
- Rogue Wave Licensing Statement

Locked pages use up memory. In fact, some specializing classes may have only a fixed number
of buffers in which to do their swapping. If you are not using the page, you should call unlock().
After calling unlock() the original address returned by lock() is no longer valid -- to use the
page again, it must be locked again with lock().
When you are completely done with the page then call deallocate() to return it to the abstract
heap.
In practice, managing this locking and unlocking and the inevitable type casts can be difficult. It
is usually easier to design a class that can work with an abstract heap to bring things in and out
of memory automatically. Indeed, this is what has been done with class
RWTValVirtualArray<T>, which represents a virtual array of elements of type T. Elements are
automatically swapped in as necessary as they are addressed.
Persistence
None
Example
This example illustrates adding N nodes to a linked list. In this linked list, a "pointer" to the
next node is actually a handle.
#include <rw/vpage.h>
struct Node {
int key;
RWHandle next;
};
RWHandle head = 0;
void addNodes(RWVirtualPageHeap& heap, unsigned N) {
for (unsigned i=0; i<N; i++){
RWHandle h = heap.allocate();
Node* newNode = (Node*)heap.lock(h);
newNode->key = i;
newNode->next = head;
head = h;
heap.dirty(h);
heap.unlock(h);
}
}