Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWCacheManager

Module:  Essential Tools Module   Group:  File System Classes


Does not inherit

Local Index

Members

Synopsis

#include <rw/cacheman.h>
RWFile f("file.dat");       // Construct a file
RWCacheManager(&f, 100);    // Cache 100 byte blocks 
                            // to file.dat

Description

Class RWCacheManager caches fixed length blocks to and from an associated RWFile. The block size can be of any length and is set at construction time. The number of cached blocks can also be set at construction time.

Writes to the file may be deferred. Use member function flush() to have any pending writes performed.

Persistence

None

Example

Program output: written to file file.dat

Public Constructor

RWCacheManager(RWFile* file, unsigned blocksz, 
               unsigned mxblks = 10);

Public Destructor

~RWCacheManager();

Public Member Functions

bool
flush();
void
invalidate();
bool
read(RWoffset locn, void* dat);
bool
write(RWoffset locn, void* dat);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.