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

Abstract conditional statement. More...

#include <AbstractConditional.h>

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

Public Member Functions

 AbstractConditional (Own< Condition > cond, Own< Operation > nested, std::string profileText="")
 
void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
AbstractConditionalclone () const override=0
 Create a clone (i.e. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. More...
 
const ConditiongetCondition () const
 Get condition that must be satisfied. More...
 
- Public Member Functions inherited from souffle::ram::NestedOperation
void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. 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...
 
- Protected Member Functions inherited from souffle::ram::NestedOperation
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< Conditioncondition
 Condition. More...
 
- Protected Attributes inherited from souffle::ram::NestedOperation
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 conditional statement.

Definition at line 39 of file AbstractConditional.h.

Constructor & Destructor Documentation

◆ AbstractConditional()

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

Definition at line 41 of file AbstractConditional.h.

45  {

References condition.

Member Function Documentation

◆ apply()

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

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 60 of file AbstractConditional.h.

61  :
62  bool equal(const Node& node) const override {
63  const auto& other = static_cast<const AbstractConditional&>(node);

References condition, souffle::ram::NestedOperation::equal(), and souffle::equal_ptr().

Here is the call graph for this function:

◆ clone()

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

Create a clone (i.e.

deep copy) of this node

Implements souffle::ram::NestedOperation.

Implemented in souffle::ram::Break, and souffle::ram::Filter.

◆ equal()

bool souffle::ram::AbstractConditional::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.

Definition at line 66 of file AbstractConditional.h.

◆ getChildNodes()

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

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 54 of file AbstractConditional.h.

56  {
58  condition = map(std::move(condition));

◆ getCondition()

const Condition& souffle::ram::AbstractConditional::getCondition ( ) const
inline

Get condition that must be satisfied.

Definition at line 49 of file AbstractConditional.h.

50  {
51  auto res = NestedOperation::getChildNodes();
52  res.push_back(condition.get());

References condition, and souffle::ram::NestedOperation::getChildNodes().

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

Here is the call graph for this function:

Field Documentation

◆ condition

Own<Condition> souffle::ram::AbstractConditional::condition
protected

Condition.

Definition at line 72 of file AbstractConditional.h.

Referenced by AbstractConditional(), apply(), and getCondition().


The documentation for this class was generated from the following file:
souffle::ram::AbstractConditional::AbstractConditional
AbstractConditional(Own< Condition > cond, Own< Operation > nested, std::string profileText="")
Definition: AbstractConditional.h:41
souffle::ram::NestedOperation::apply
void apply(const NodeMapper &map) override
Apply the mapper to all child nodes.
Definition: NestedOperation.h:75
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::ram::AbstractConditional::condition
Own< Condition > condition
Condition.
Definition: AbstractConditional.h:72
souffle::ram::AbstractConditional::equal
bool equal(const Node &node) const override
Equality check for two RAM nodes.
Definition: AbstractConditional.h:66
souffle::ram::NestedOperation::getChildNodes
std::vector< const Node * > getChildNodes() const override
Obtain list of all embedded child nodes.
Definition: NestedOperation.h:71