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

Abstract class for a list of RAM statements. More...

#include <ListStatement.h>

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

Public Member Functions

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...
 
std::vector< Statement * > getStatements () const
 Get statements. More...
 
 ListStatement ()=default
 
template<typename... Stmts>
 ListStatement (Own< Stmts > &&... stmts)
 
 ListStatement (VecOwn< Statement > statements)
 
- Public Member Functions inherited from souffle::ram::Statement
Statementclone () const override=0
 Create a clone (i.e. More...
 
- 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::Statement
void print (std::ostream &os) const override
 Print RAM node. More...
 
virtual void print (std::ostream &os, int tabpos) const =0
 Pretty print with indentation. More...
 

Protected Attributes

VecOwn< Statementstatements
 Ordered list of RAM statements. More...
 

Additional Inherited Members

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

Detailed Description

Abstract class for a list of RAM statements.

Definition at line 36 of file ListStatement.h.

Constructor & Destructor Documentation

◆ ListStatement() [1/3]

souffle::ram::ListStatement::ListStatement ( )
default

◆ ListStatement() [2/3]

souffle::ram::ListStatement::ListStatement ( VecOwn< Statement statements)
inline

Definition at line 39 of file ListStatement.h.

39 {std::move(stmts)...};

◆ ListStatement() [3/3]

template<typename... Stmts>
souffle::ram::ListStatement::ListStatement ( Own< Stmts > &&...  stmts)
inline

Definition at line 42 of file ListStatement.h.

47  {
48  return toPtrVector(statements);

Member Function Documentation

◆ apply()

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

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 63 of file ListStatement.h.

65  :
66  bool equal(const Node& node) const override {
67  const auto& other = static_cast<const ListStatement&>(node);

◆ equal()

bool souffle::ram::ListStatement::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 70 of file ListStatement.h.

71  :
72  /** Ordered list of RAM statements */
73  VecOwn<Statement> statements;

◆ getChildNodes()

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

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 55 of file ListStatement.h.

59  {
60  for (auto& stmt : statements) {
61  stmt = map(std::move(stmt));

◆ getStatements()

std::vector<Statement*> souffle::ram::ListStatement::getStatements ( ) const
inline

Get statements.

Definition at line 51 of file ListStatement.h.

51  {
52  std::vector<const Node*> res;
53  for (const auto& cur : statements) {

References statements.

Field Documentation

◆ statements

VecOwn<Statement> souffle::ram::ListStatement::statements
protected

Ordered list of RAM statements.

Definition at line 77 of file ListStatement.h.

Referenced by getStatements().


The documentation for this class was generated from the following file:
souffle::ram::ListStatement::ListStatement
ListStatement()=default
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::ListStatement::statements
VecOwn< Statement > statements
Ordered list of RAM statements.
Definition: ListStatement.h:77
souffle::ram::ListStatement::equal
bool equal(const Node &node) const override
Equality check for two RAM nodes.
Definition: ListStatement.h:70
souffle::toPtrVector
std::vector< T * > toPtrVector(const std::vector< std::unique_ptr< T >> &v)
A utility function enabling the creation of a vector of pointers.
Definition: ContainerUtil.h:146