souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::ram::AbstractChoice Class Reference

Abstract class for a choice operation. More...

#include <AbstractChoice.h>

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

Public Member Functions

 AbstractChoice (Own< Condition > cond)
 
void apply (const NodeMapper &map)
 
std::vector< const Node * > getChildNodes () const
 
const ConditiongetCondition () const
 Getter for the condition. More...
 

Protected Member Functions

bool equal (const Node &node) const
 

Protected Attributes

Own< Conditioncondition
 Condition for which a tuple in the relation may hold. More...
 

Detailed Description

Abstract class for a choice operation.

Finding a single tuple, if it exists, such that a condition holds.

Definition at line 38 of file AbstractChoice.h.

Constructor & Destructor Documentation

◆ AbstractChoice()

souffle::ram::AbstractChoice::AbstractChoice ( Own< Condition cond)
inline

Definition at line 40 of file AbstractChoice.h.

41  {
42  assert(condition != nullptr && "condition of choice is a null-pointer");

References condition.

Member Function Documentation

◆ apply()

void souffle::ram::AbstractChoice::apply ( const NodeMapper map)
inline

Definition at line 50 of file AbstractChoice.h.

50  {
51  return {condition.get()};
52  }

References condition.

◆ equal()

bool souffle::ram::AbstractChoice::equal ( const Node node) const
inlineprotected

Definition at line 59 of file AbstractChoice.h.

◆ getChildNodes()

std::vector<const Node*> souffle::ram::AbstractChoice::getChildNodes ( ) const
inline

Definition at line 54 of file AbstractChoice.h.

54  :
55  bool equal(const Node& node) const {
56  const auto& other = dynamic_cast<const AbstractChoice&>(node);

References condition, and souffle::equal_ptr().

Referenced by souffle::ram::Choice::clone().

Here is the call graph for this function:

◆ getCondition()

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

Getter for the condition.

Definition at line 45 of file AbstractChoice.h.

46  {
47  condition = map(std::move(condition));
48  }

References condition, and souffle::map().

Here is the call graph for this function:

Field Documentation

◆ condition

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

Condition for which a tuple in the relation may hold.

Definition at line 65 of file AbstractChoice.h.

Referenced by AbstractChoice(), apply(), getChildNodes(), getCondition(), and souffle::ram::ParallelChoice::ParallelChoice().


The documentation for this class was generated from the following file:
souffle::ram::AbstractChoice::AbstractChoice
AbstractChoice(Own< Condition > cond)
Definition: AbstractChoice.h:40
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::AbstractChoice::equal
bool equal(const Node &node) const
Definition: AbstractChoice.h:59
souffle::ram::AbstractChoice::condition
Own< Condition > condition
Condition for which a tuple in the relation may hold.
Definition: AbstractChoice.h:65