#include <record.h>
SwatDB Record Class. Record instantiates record in SwatDB. It consists of record data Data object, which is serialized in form of variable length record and Schema object, which allows appropriate access to the record data.
◆ Record()
Record::Record |
( |
Schema * |
schema, |
|
|
Data * |
record_data |
|
) |
| |
Constructor given appropriate Data* and Schema*.
- Precondition
- Valid Data* and Schema* are provided as input. The schema and the record data stored by record_data are consistent.
- Postcondition
- schema and record_data are set to the provided input.
- Parameters
-
schema | Schema* of the Record. |
record_data | Data* record_data that stores the Record data. |
◆ ~Record()
Destructor.
- Precondition
- None.
- Postcondition
- Neither schema nor record_data is deleted. Both data members have to be deallocated manually by the user.
◆ compare()
std::int32_t Record::compare |
( |
Record |
other | ) |
|
Compare function for comparing 2 records.
- Precondition
- Valid Record object is provided as input.
- Postcondition
- If the schemas are different, -1 is returned. If the record_data of the two records do not have the same size or do not have the identical array up to first size number of bytes, -1 is returned. Else, 0 is returned.
- Parameters
-
other | The Record to be compared to. |
- Returns
- -1 if the two records are not the same. 0 if the two records are the same.
◆ getRecordData()
Data* Record::getRecordData |
( |
| ) |
|
Getter for record_data.
- Precondition
- None.
- Postcondition
- record_data is returned.
- Returns
- Data* to the record_data of the Record.
◆ getSchema()
Getter function for schema.
- Precondition
- None.
- Postcondition
- schema is returned.
- Returns
- Schema* to the schema of the Record.
◆ setRecordData()
void Record::setRecordData |
( |
Data * |
new_data | ) |
|
Setter for record_data.
- Precondition
- Valid Data* is provided as an input.
- Postcondition
- record_data is set to new_data. The previous data is not deleted.
- Parameters
-
new_data | New Data* schema is set to. |
◆ setSchema()
void Record::setSchema |
( |
Schema * |
new_schema | ) |
|
Setter for schema.
- Precondition
- Valid Schema* is provided as an input.
- Postcondition
- schema is set to new_schema. The previous schema is not deleted.
- Parameters
-
new_schema | New Schema* schema is set to. |
◆ record_data
Data* Record::record_data |
|
private |
Data of the Record. The object (not the pointer) is never modified in scope of this object.
◆ schema
Schema of the Record. The object (not the pointer) is never modified in scope of this object.
The documentation for this class was generated from the following file: