RWCacheManager man page on IRIX

Man page or keyword search:  
man Server   31559 pages
apropos Keyword Search (all sections)
Output format
IRIX logo
[printable version]



RWCacheManager(3C++)					  RWCacheManager(3C++)

Name
     RWCacheManager - Rogue Wave library class

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
	      #include <rw/cacheman.h>
	  #include <rw/rwfile.h>
	  struct Record {
	    int i;
	    float f;
	    char str[15];
	  };
	  main(){
	     RWoffset loc;
	     RWFile file("file.dat");	  // Construct a file
	     // Construct a cache, using 20 slots for struct Record:
		RWCacheManager cache(&file, sizeof(Record), 20);
	     Record r;
	     // ...
	     cache.write(loc, &r);
	     // ...
	     cache.read(loc, &r);
	  }

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

     Construct a cache for the RWFile pointed to by file.  The length of the
     fixed-size blocks is given by blocksz.  The number of cached blocks is
     given by mxblks.  If the total number of bytes cached would exceed the

									Page 1

RWCacheManager(3C++)					  RWCacheManager(3C++)

     maximum value of an unsigned int, then RWCacheManager will quietly decide
     to cache a smaller number of blocks.

Public Destructor
	      ~RWCacheManager();

     Performs any pending I/O operations (i.e., calls flush()) and deallocates
     any allocated memory.

Public Member Functions
	      RWBoolean
	  flush();

     Perform any pending I/O operations.  Returns TRUE if the flush was
     successful, FALSE otherwise.

	      void
	  invalidate();

     Invalidate the cache.

	      RWBoolean
	  read(RWoffset locn, void* dat);

     Return the data located at offset locn of the associated RWFile.  The
     data is put in the buffer pointed to by dat.  This buffer must be at
     least as long as the block size specified when the cache was constructed.
     Returns TRUE if the operation was successful, otherwise FALSE.

	      RWBoolean
	  write(RWoffset locn, void* dat);

     Write the block of data pointed to by dat to the offset locn of the
     associated RWFile.	 The number of bytes written is given by the block
     size specified when the cache was constructed.  The actual write to disk
     may be deferred.  Use member function flush() to perform any pending
     output.  Returns TRUE if the operation was successful, otherwise FALSE.

									Page 2

[top]

List of man pages available for IRIX

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net