SwatDB
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Project Class Reference

#include <project.h>

Inheritance diagram for Project:
Inheritance graph
[legend]
Collaboration diagram for Project:
Collaboration graph
[legend]

Public Member Functions

 Project (FileId rel_id, FileId result_id, std::vector< FieldId > fields, Catalog *catalog)
 Constructor for Project operation.
 
 ~Project ()
 Destructor for the Select Operation.
 
void runOperation ()
 Runs the operation.

 
- Public Member Functions inherited from Operation
 Operation (FileId result_id, Catalog *catalog)
 Constructor for the Operation class. Because Operation is an abstract class, an object cannot be created, but this constructor is used by derived classes.
 
virtual ~Operation ()
 Destructor for the Operation class. Cleans up dynamic memory in result state.
 

Protected Attributes

std::vector< FieldIdfields
 
fileState file_state
 
- Protected Attributes inherited from Operation
fileState result_state
 
Catalogcatalog
 

Additional Inherited Members

- Protected Member Functions inherited from Operation
void _initState (FileId file_id, std::vector< FieldId > fields, fileState *state)
 Performs the file and temporary record setup for relational operators.
 
void _delState (fileState *file_state)
 Deletes objects created in relop structs.
 

Detailed Description

Project is a derived class of operation that implements the project operation, which removes some number of columns from a relation.

Constructor & Destructor Documentation

◆ Project()

Project::Project ( FileId  rel_id,
FileId  result_id,
std::vector< FieldId fields,
Catalog catalog 
)

Constructor for Project operation.

Parameters
rel_id.FileId of the relation file.
result_id.FileId of the result file.
fields.Vector of field ids for the select operation.
catalog.pointer to the catalog of SwatDB
Precondition
rel_id is the name of a valid file.
Postcondition
private variables have been set accordingly.

Member Function Documentation

◆ runOperation()

void Project::runOperation ( )
virtual

Runs the operation.

Precondition
Valid files and parameters have been passed to the contructor.
Postcondition
Result file has been populated with all the records of the original relation, with the new schema only consisting of fields that were specified by passing them into the constructor.

Implements Operation.

Member Data Documentation

◆ fields

std::vector<FieldId> Project::fields
protected

Fields that will be kept following the execution of the project operation.


The documentation for this class was generated from the following file: