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

Operator that represents an intrinsic (built-in) functor. More...

#include <IntrinsicOperator.h>

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

Public Member Functions

IntrinsicOperatorclone () const override
 Create a clone (i.e. More...
 
FunctorOp getOperator () const
 Get operator symbol. More...
 
template<typename... Args>
 IntrinsicOperator (FunctorOp op, Args... args)
 
 IntrinsicOperator (FunctorOp op, VecOwn< Expression > args)
 
- Public Member Functions inherited from souffle::ram::AbstractOperator
 AbstractOperator (VecOwn< Expression > args)
 
void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
std::vector< Expression * > getArguments () const
 Get argument values. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. 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...
 
void print (std::ostream &os) const override
 Print RAM node. More...
 

Protected Attributes

const FunctorOp operation
 Operation symbol. More...
 
- Protected Attributes inherited from souffle::ram::AbstractOperator
VecOwn< Expressionarguments
 Arguments of user defined operator. More...
 

Detailed Description

Operator that represents an intrinsic (built-in) functor.

Definition at line 42 of file IntrinsicOperator.h.

Constructor & Destructor Documentation

◆ IntrinsicOperator() [1/2]

template<typename... Args>
souffle::ram::IntrinsicOperator::IntrinsicOperator ( FunctorOp  op,
Args...  args 
)
inline

Definition at line 45 of file IntrinsicOperator.h.

45 {

References operation.

◆ IntrinsicOperator() [2/2]

souffle::ram::IntrinsicOperator::IntrinsicOperator ( FunctorOp  op,
VecOwn< Expression args 
)
inline

Definition at line 47 of file IntrinsicOperator.h.

49  {

Member Function Documentation

◆ clone()

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

Create a clone (i.e.

deep copy) of this node

Implements souffle::ram::Expression.

Definition at line 55 of file IntrinsicOperator.h.

57  :
58  void print(std::ostream& os) const override {
60  os << "(" << join(arguments, tfm::format("%s", operation)) << ")";
61  } else {

◆ equal()

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

Equality check for two RAM nodes.

Default action is that nothing needs to be checked.

Reimplemented from souffle::ram::AbstractOperator.

Definition at line 72 of file IntrinsicOperator.h.

◆ getOperator()

FunctorOp souffle::ram::IntrinsicOperator::getOperator ( ) const
inline

Get operator symbol.

Definition at line 51 of file IntrinsicOperator.h.

51  : arguments) {
52  argsCopy.emplace_back(arg->clone());
53  }

◆ print()

void souffle::ram::IntrinsicOperator::print ( std::ostream &  out) const
inlineoverrideprotectedvirtual

Print RAM node.

Implements souffle::ram::Node.

Definition at line 64 of file IntrinsicOperator.h.

66  {
67  const auto& other = static_cast<const IntrinsicOperator&>(node);
68  return AbstractOperator::equal(node) && operation == other.operation;
69  }
70 

Field Documentation

◆ operation

const FunctorOp souffle::ram::IntrinsicOperator::operation
protected

Operation symbol.

Definition at line 78 of file IntrinsicOperator.h.

Referenced by IntrinsicOperator().


The documentation for this class was generated from the following file:
souffle::ram::AbstractOperator::equal
bool equal(const Node &node) const override
Equality check for two RAM nodes.
Definition: AbstractOperator.h:68
souffle::ram::IntrinsicOperator::print
void print(std::ostream &os) const override
Print RAM node.
Definition: IntrinsicOperator.h:64
souffle::ram::AbstractOperator::arguments
VecOwn< Expression > arguments
Arguments of user defined operator.
Definition: AbstractOperator.h:74
tinyformat::format
void format(std::ostream &out, const char *fmt)
Definition: tinyformat.h:1089
souffle::ram::IntrinsicOperator::operation
const FunctorOp operation
Operation symbol.
Definition: IntrinsicOperator.h:78
souffle::join
detail::joined_sequence< Iter, Printer > join(const Iter &a, const Iter &b, const std::string &sep, const Printer &p)
Creates an object to be forwarded to some output stream for printing sequences of elements interspers...
Definition: StreamUtil.h:175
souffle::ram::IntrinsicOperator::IntrinsicOperator
IntrinsicOperator(FunctorOp op, Args... args)
Definition: IntrinsicOperator.h:45
souffle::isInfixFunctorOp
bool isInfixFunctorOp(std::string_view symbol)
Determines whether a functor should be written using infix notation (e.g.
Definition: FunctorOps.cpp:252