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

#include <operation.h>

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

Public Member Functions

 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.
 
virtual void runOperation ()=0
 Runs the operation. Other than initial setup in the initialization, all the work of each operation is done in this function. It is a pure virtual method, and is implemented in inherited classes. All child classes must implement this method.
 

Protected Member Functions

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.
 

Protected Attributes

fileState result_state
 
Catalogcatalog
 

Detailed Description

SwatDB Operation Class. The interface to indivual relational operators operations the system:

Constructor & Destructor Documentation

◆ Operation()

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.

Precondition
result_id is the id of a valid newly created result file.
Parameters
result_namestd::string of a newly created result file

Member Function Documentation

◆ _delState()

void Operation::_delState ( fileState file_state)
protected

Deletes objects created in relop structs.

Postcondition
Dynamic objects are deleted
Parameters
fileStatestruct to be deleted

◆ _initState()

void Operation::_initState ( FileId  file_id,
std::vector< FieldId fields,
fileState state 
)
protected

Performs the file and temporary record setup for relational operators.

Precondition
A file exists that corresponds to the param rel_name
Parameters
file_idFileId corresponding to the relation of interest
fieldsstd::vector<FieldId> that stores the fields with which to make the key
statefileState pointer that will be filled

◆ runOperation()

virtual void Operation::runOperation ( )
pure virtual

Runs the operation. Other than initial setup in the initialization, all the work of each operation is done in this function. It is a pure virtual method, and is implemented in inherited classes. All child classes must implement this method.

Precondition
Valid files and parameters have been passed to the contructor.
Postcondition
Result file has been populated with records that meet the criteria of the operation.

Implemented in BlockNLJ, FileScan, HashJoin, IndexNLJ, IndexScan, ParallelHashJoin, Project, and TupleNLJ.


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