A class for handling file IO for ibis::rid_t. More...
#include <rids.h>
Public Member Functions | |
| int | append (const RIDSet &rids, const char *destination) const |
| Append the rid set to the name file. More... | |
| int | read (RIDSet &rids, const char *source) |
| This function is capable of reading a file written with one write command and multiple append commands. More... | |
| ridHandler (const char *dbName, const char *pref="ibis") | |
| int | write (const RIDSet &rids, const char *destination, const char *dbName=0) |
| Write the rid set. More... | |
Protected Attributes | |
| char * | _dbName |
| char * | _prefix |
| pthread_mutex_t | mutex |
Static Protected Attributes | |
| static const char *const | version = "0.3" |
| Implements the functions defined in ibis::ridHandler. | |
A class for handling file IO for ibis::rid_t.
| int ibis::ridHandler::append | ( | const RIDSet & | rids, |
| const char * | fname | ||
| ) | const |
Append the rid set to the name file.
Return the number of rids written. This function can be called after ibis::ridHandler::write has been called to write a file. It can be called many times. The function ibis::ridHandler::read will concatenate all rid sets into one.
References ibis::array_t< T >::size().
| int ibis::ridHandler::read | ( | ibis::RIDSet & | rids, |
| const char * | fname | ||
| ) |
This function is capable of reading a file written with one write command and multiple append commands.
All rids are placed in rids in the order they appear in the file. The member varialbe _dbName will be set to the name stored in the file.
References ibis::array_t< T >::push_back(), ibis::array_t< T >::reserve(), and ibis::array_t< T >::size().
| int ibis::ridHandler::write | ( | const RIDSet & | rids, |
| const char * | fname, | ||
| const char * | dbName = 0 |
||
| ) |
Write the rid set.
Return the number of rids written. If the first argument is specified, the internally stored dbName would be modified.
References ibis::array_t< T >::size(), and ibis::util::strnewdup().
|
| |