rids.h
Go to the documentation of this file.
00001 // $Id$
00002 // Copyright 2003-2011 the Regents of the University of California
00003 // Author: John Wu <John.Wu at acm.org>
00004 //      Lawrence Berkeley National Laboratory
00005 #ifndef IBIS_RIDS_H
00006 #define IBIS_RIDS_H
00007 #include "utilidor.h"   // ibis::RIDSet
00011 
00012 namespace ibis {
00013     class ridHandler;
00014 }
00015 
00017 class ibis::ridHandler {
00018  public:
00019     ridHandler(const char* dbName, const char* pref="ibis");
00020     ~ridHandler();
00021 
00022     // Read a set of rids from a file.
00023     int read(RIDSet& rids, const char* source);
00024     // Write a set of rids to a file.
00025     int write(const RIDSet& rids, const char* destination,
00026               const char* dbName=0);
00027     // Append a set of rids to an existing rid file.
00028     int append(const RIDSet& rids, const char* destination) const;
00029 
00030  protected:
00031     // member variables
00032     char* _dbName;  // name of the rid set
00033     char* _prefix;  // prefix in the names of the parameters
00034     mutable pthread_mutex_t mutex; // a mutex lock
00035 
00036     // class variables used as internal parameters
00037     static const char *const version; // Internal version number.
00038 
00039     int readDBName(std::istream& _from);
00040     int matchDBName(std::istream& _from) const;
00041     int readVersion(std::istream& _from) const;
00042     int readRidCount(std::istream& _from, int& ic) const;
00043 
00044 private:
00045     ridHandler(const ridHandler&);
00046     ridHandler& operator=(const ridHandler&);
00047 };
00048 #endif

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive