souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::ram::NestedOperation Class Referenceabstract

Abstract class for a nesting operations in a loop-nest. More...

#include <NestedOperation.h>

Inheritance diagram for souffle::ram::NestedOperation:
Inheritance graph
Collaboration diagram for souffle::ram::NestedOperation:
Collaboration graph

Public Member Functions

void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
NestedOperationclone () const override=0
 Create a clone (i.e. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. More...
 
OperationgetOperation () const
 Get nested operation. More...
 
const std::string & getProfileText () const
 Get profile text. More...
 
 NestedOperation (Own< Operation > nested, std::string profileText="")
 
- Public Member Functions inherited from souffle::ram::Node
bool operator!= (const Node &other) const
 Inequality check for two RAM nodes. More...
 
bool operator== (const Node &other) const
 Equivalence check for two RAM nodes. More...
 
virtual void rewrite (const Node *oldNode, Own< Node > newNode)
 Rewrite a child node. More...
 
virtual ~Node ()=default
 

Protected Member Functions

bool equal (const Node &node) const override
 Equality check for two RAM nodes. More...
 
void print (std::ostream &os, int tabpos) const override
 Pretty print with indentation. More...
 
- Protected Member Functions inherited from souffle::ram::Operation
void print (std::ostream &os) const override
 Print RAM node. More...
 

Protected Attributes

Own< OperationnestedOperation
 Nested operation. More...
 
const std::string profileText
 Text used by the profiler. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from souffle::ram::Operation
static void print (const Operation *operation, std::ostream &os, int tabpos)
 Pretty print jump-bed. More...
 

Detailed Description

Abstract class for a nesting operations in a loop-nest.

In the following example, the nested operation of "IF C1" is "IF C2":

QUERY
...
IF C1
IF C2
...

TODO (b-scholz): profile text is awkward; perhaps there is a better way of storing profile information for RAM operations since it is not always used for all RAM operations.

Definition at line 52 of file NestedOperation.h.

Constructor & Destructor Documentation

◆ NestedOperation()

souffle::ram::NestedOperation::NestedOperation ( Own< Operation nested,
std::string  profileText = "" 
)
inline

Definition at line 54 of file NestedOperation.h.

58  {

References nestedOperation.

Member Function Documentation

◆ apply()

void souffle::ram::NestedOperation::apply ( const NodeMapper )
inlineoverridevirtual

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::Node.

Reimplemented in souffle::ram::UnpackRecord.

Definition at line 75 of file NestedOperation.h.

75  :
76  void print(std::ostream& os, int tabpos) const override {
77  Operation::print(nestedOperation.get(), os, tabpos);

References nestedOperation, and souffle::ram::Operation::print().

Referenced by souffle::ram::Aggregate::clone(), souffle::ram::UnpackRecord::clone(), and souffle::ram::NestedIntrinsicOperator::clone().

Here is the call graph for this function:

◆ clone()

NestedOperation* souffle::ram::NestedOperation::clone ( ) const
overridepure virtual

◆ equal()

bool souffle::ram::NestedOperation::equal ( const Node ) const
inlineoverrideprotectedvirtual

Equality check for two RAM nodes.

Default action is that nothing needs to be checked.

Reimplemented from souffle::ram::Node.

Reimplemented in souffle::ram::UnpackRecord, souffle::ram::TupleOperation, and souffle::ram::RelationOperation.

Definition at line 84 of file NestedOperation.h.

Referenced by souffle::ram::AbstractConditional::apply(), and souffle::ram::TupleOperation::getChildNodes().

◆ getChildNodes()

std::vector<const Node*> souffle::ram::NestedOperation::getChildNodes ( ) const
inlineoverridevirtual

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::Node.

Reimplemented in souffle::ram::UnpackRecord, and souffle::ram::TupleOperation.

Definition at line 71 of file NestedOperation.h.

71  {
72  nestedOperation = map(std::move(nestedOperation));
73  }

References souffle::map(), and nestedOperation.

Referenced by souffle::ram::AbstractConditional::getCondition(), and souffle::ram::TupleOperation::setTupleId().

Here is the call graph for this function:

◆ getOperation()

Operation& souffle::ram::NestedOperation::getOperation ( ) const
inline

◆ getProfileText()

const std::string& souffle::ram::NestedOperation::getProfileText ( ) const
inline

Get profile text.

Definition at line 67 of file NestedOperation.h.

67  {
68  return {nestedOperation.get()};
69  }

References nestedOperation.

Referenced by souffle::ram::transform::CollapseFiltersTransformer::collapseFilters(), and souffle::ram::ParallelChoice::ParallelChoice().

◆ print()

void souffle::ram::NestedOperation::print ( std::ostream &  os,
int  tabpos 
) const
inlineoverrideprotectedvirtual

Pretty print with indentation.

Implements souffle::ram::Operation.

Reimplemented in souffle::ram::UnpackRecord, souffle::ram::ParallelIndexChoice, souffle::ram::ParallelIndexScan, souffle::ram::ParallelIndexAggregate, souffle::ram::ParallelAggregate, souffle::ram::ParallelChoice, souffle::ram::ParallelScan, and souffle::ram::Scan.

Definition at line 80 of file NestedOperation.h.

80  {
81  const auto& other = static_cast<const NestedOperation&>(node);
82  return equal_ptr(nestedOperation, other.nestedOperation) && profileText == other.profileText;

References souffle::equal_ptr(), nestedOperation, and profileText.

Referenced by souffle::ram::UnpackRecord::apply(), souffle::ram::Break::clone(), and souffle::ram::Filter::clone().

Here is the call graph for this function:

Field Documentation

◆ nestedOperation

Own<Operation> souffle::ram::NestedOperation::nestedOperation
protected

Nested operation.

Definition at line 90 of file NestedOperation.h.

Referenced by apply(), souffle::ram::Choice::clone(), getChildNodes(), getProfileText(), NestedOperation(), and print().

◆ profileText

const std::string souffle::ram::NestedOperation::profileText
protected

Text used by the profiler.

Definition at line 93 of file NestedOperation.h.

Referenced by getOperation(), and print().


The documentation for this class was generated from the following file:
souffle::ram::NestedOperation::profileText
const std::string profileText
Text used by the profiler.
Definition: NestedOperation.h:93
souffle::ram::NestedOperation::NestedOperation
NestedOperation(Own< Operation > nested, std::string profileText="")
Definition: NestedOperation.h:54
souffle::map
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
Definition: ContainerUtil.h:158
souffle::equal_ptr
bool equal_ptr(const T *a, const T *b)
Compares two values referenced by a pointer where the case where both pointers are null is also consi...
Definition: MiscUtil.h:130
souffle::ram::NestedOperation::nestedOperation
Own< Operation > nestedOperation
Nested operation.
Definition: NestedOperation.h:90
souffle::ram::NestedOperation::print
void print(std::ostream &os, int tabpos) const override
Pretty print with indentation.
Definition: NestedOperation.h:80
souffle::ram::Operation::print
void print(std::ostream &os) const override
Print RAM node.
Definition: Operation.h:39