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

Record lookup. More...

#include <UnpackRecord.h>

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

Public Member Functions

void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
UnpackRecordclone () const override
 Create a clone (i.e. More...
 
std::size_t getArity () const
 Get arity of record. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. More...
 
const ExpressiongetExpression () const
 Get record expression. More...
 
 UnpackRecord (Own< Operation > nested, int ident, Own< Expression > expr, size_t arity)
 
- Public Member Functions inherited from souffle::ram::TupleOperation
int getTupleId () const
 Get identifier. More...
 
void setTupleId (int id)
 Set identifier. More...
 
 TupleOperation (int ident, Own< Operation > nested, std::string profileText="")
 
- Public Member Functions inherited from souffle::ram::NestedOperation
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

const size_t arity
 Arity of the unpacked tuple. More...
 
Own< Expressionexpression
 Expression for record reference. More...
 
- Protected Attributes inherited from souffle::ram::TupleOperation
int identifier
 Identifier for the tuple, corresponding to its position in the loop nest. 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

Record lookup.

Looks up a record with respect to an expression

For example:

UNPACK t0.0 INTO t1

Definition at line 51 of file UnpackRecord.h.

Constructor & Destructor Documentation

◆ UnpackRecord()

souffle::ram::UnpackRecord::UnpackRecord ( Own< Operation nested,
int  ident,
Own< Expression expr,
size_t  arity 
)
inline

Definition at line 53 of file UnpackRecord.h.

55  {
56  assert(expression != nullptr && "Expression of unpack-record is a null-pointer");

References expression.

Member Function Documentation

◆ apply()

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

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::NestedOperation.

Definition at line 80 of file UnpackRecord.h.

81  :
82  void print(std::ostream& os, int tabpos) const override {
83  os << times(" ", tabpos);

References expression, souffle::ram::TupleOperation::getTupleId(), souffle::ram::NestedOperation::print(), and souffle::times().

Here is the call graph for this function:

◆ clone()

UnpackRecord* souffle::ram::UnpackRecord::clone ( ) const
inlineoverridevirtual

Create a clone (i.e.

deep copy) of this node

Implements souffle::ram::TupleOperation.

Definition at line 75 of file UnpackRecord.h.

76  {
78  expression = map(std::move(expression));

References souffle::ram::NestedOperation::apply(), expression, and souffle::map().

Here is the call graph for this function:

◆ equal()

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

Equality check for two RAM nodes.

Default action is that nothing needs to be checked.

Reimplemented from souffle::ram::TupleOperation.

Definition at line 92 of file UnpackRecord.h.

◆ getArity()

std::size_t souffle::ram::UnpackRecord::getArity ( ) const
inline

Get arity of record.

Definition at line 65 of file UnpackRecord.h.

65  {
66  auto res = TupleOperation::getChildNodes();
67  res.push_back(expression.get());

References expression, and souffle::ram::TupleOperation::getChildNodes().

Here is the call graph for this function:

◆ getChildNodes()

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

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::TupleOperation.

Definition at line 69 of file UnpackRecord.h.

◆ getExpression()

const Expression& souffle::ram::UnpackRecord::getExpression ( ) const
inline

Get record expression.

Definition at line 59 of file UnpackRecord.h.

61  {
62  return arity;

References arity.

◆ print()

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

Pretty print with indentation.

Reimplemented from souffle::ram::NestedOperation.

Definition at line 86 of file UnpackRecord.h.

88  {
89  const auto& other = static_cast<const UnpackRecord&>(node);
90  return TupleOperation::equal(other) && equal_ptr(expression, other.expression) &&

Field Documentation

◆ arity

const size_t souffle::ram::UnpackRecord::arity
protected

Arity of the unpacked tuple.

Definition at line 102 of file UnpackRecord.h.

Referenced by getExpression().

◆ expression

Own<Expression> souffle::ram::UnpackRecord::expression
protected

Expression for record reference.

Definition at line 99 of file UnpackRecord.h.

Referenced by apply(), clone(), getArity(), and UnpackRecord().


The documentation for this class was generated from the following file:
souffle::ram::TupleOperation::getChildNodes
std::vector< const Node * > getChildNodes() const override
Obtain list of all embedded child nodes.
Definition: TupleOperation.h:52
souffle::ram::NestedOperation::apply
void apply(const NodeMapper &map) override
Apply the mapper to all child nodes.
Definition: NestedOperation.h:75
souffle::ram::NestedOperation::getOperation
Operation & getOperation() const
Get nested operation.
Definition: NestedOperation.h:62
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::TupleOperation::equal
bool equal(const Node &node) const override
Equality check for two RAM nodes.
Definition: TupleOperation.h:57
souffle::ram::UnpackRecord::UnpackRecord
UnpackRecord(Own< Operation > nested, int ident, Own< Expression > expr, size_t arity)
Definition: UnpackRecord.h:53
souffle::clone
auto clone(const std::vector< A * > &xs)
Definition: ContainerUtil.h:172
souffle::times
detail::multiplying_printer< T > times(const T &value, unsigned num)
A utility printing a given value multiple times.
Definition: StreamUtil.h:322
souffle::ram::UnpackRecord::arity
const size_t arity
Arity of the unpacked tuple.
Definition: UnpackRecord.h:102
souffle::ram::UnpackRecord::print
void print(std::ostream &os, int tabpos) const override
Pretty print with indentation.
Definition: UnpackRecord.h:86
souffle::ram::TupleOperation::getTupleId
int getTupleId() const
Get identifier.
Definition: TupleOperation.h:43
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::UnpackRecord::expression
Own< Expression > expression
Expression for record reference.
Definition: UnpackRecord.h:99
souffle::ram::UnpackRecord::getExpression
const Expression & getExpression() const
Get record expression.
Definition: UnpackRecord.h:59