/* bucketfile.h * * This is the header file for the Bucketfile data type. * */ #ifndef BUCKETFILE_H #define BUCKETFILE_H #include using namespace std; // This is the Bucketfile class // It represents a Bucketfile entry from the input file. class Bucketfile { private: int numKeys; // the number of keys int depthBucket; // the depth of the bucket long int keys0,keys1,keys2,keys3,keys4; // the keys---student's id int recAddr0,recAddr1,recAddr2,recAddr3,recAddr4; // the keys' record address int maxKeysize; int numKeys_length; int depthBucket_length; int keys_length; int recAddr_length; // set the record size, which is the sum of the lengths // of the student number field, the name field, and // extra end-of-line characters int recsize; public: // This constructor sets up the Student object. Bucketfile(); // This is the destructor for the class. virtual ~Bucketfile(); // NumKeys accessors int getNumKeys() const; void setNumKeys(int); // DepthBucket accessors int getDepthBucket() const; void setDepthBucket(int); // Keys accessors long int getKeys0() const; void setKeys0(long int); // Keys accessors long int getKeys1() const; void setKeys1(long int); // Keys accessors long int getKeys2() const; void setKeys2(long int); // Keys accessors long int getKeys3() const; void setKeys3(long int); // Keys accessors long int getKeys4() const; void setKeys4(long int); // RecAddr accessors int getRecAddr0() const; void setRecAddr0(int); // RecAddr accessors int getRecAddr1() const; void setRecAddr1(int); // RecAddr accessors int getRecAddr2() const; void setRecAddr2(int); // RecAddr accessors int getRecAddr3() const; void setRecAddr3(int); // RecAddr accessors int getRecAddr4() const; void setRecAddr4(int); // seek to the appropriate position for reading void InputPositioningByRRN(int RRN, istream&); // seek to the appropriate position for writing void OutputPositioningByRRN(int RRN, ostream&); // modify the name of a student stored in a file void ModifyBucketFileNumKeys(int, ostream&,int); // modify the name of a student stored in a file void ModifyBucketFileDepthBucket(int, ostream&,int); // modify the name of a student stored in a file void ModifyBucketFileKey(int, ostream&, long,int); // modify the name of a student stored in a file void ModifyBucketFileRecAddr(int, ostream&, int,int); // modify the line to a void line void ModifyBucketFileToVoid(int, ostream&); // read a bucket in the bucket file void readBucketfile(int, istream&); // write a bucket in the bucket file void writeBucketfile(ostream& output); }; #endif