souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
46 class Project :
public Operation {
51 assert(expr !=
nullptr &&
"Expression is a null-pointer");
61 std::vector<Expression*>
getValues()
const {
66 std::vector<const Node*> res;
68 res.push_back(expr.get());
76 newValues.emplace_back(expr->clone());
81 void apply(
const NodeMapper&
map)
override {
83 expr =
map(std::move(expr));
88 void print(std::ostream& os,
int tabpos)
const override {
89 os <<
times(
" ", tabpos);
94 bool equal(
const Node& node)
const override {
95 const auto& other =
static_cast<const Project&
>(node);
std::vector< const Node * > getChildNodes() const override
Obtain list of all embedded child nodes.
VecOwn< Expression > expressions
bool equal(const Node &node) const override
Equality check for two RAM nodes.
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
A functor printing elements after dereferencing it.
std::string relation
Relation name.
Project * clone() const override
Create a clone (i.e.
void apply(const NodeMapper &map) override
Apply the mapper to all child nodes.
Node is a superclass for all RAM IR classes.
Project(std::string rel, VecOwn< Expression > expressions)
detail::multiplying_printer< T > times(const T &value, unsigned num)
A utility printing a given value multiple times.
Project a result into the target relation.
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...
bool equal_targets(const Container &a, const Container &b, const Comparator &comp)
A function testing whether two containers are equal with the given Comparator.
std::vector< Expression * > getValues() const
Get expressions.
const std::string & getRelation() const
Get relation.
void rel(size_t limit, bool showLimit=true)
void print(std::ostream &os, int tabpos) const override
Pretty print with indentation.
std::vector< T * > toPtrVector(const std::vector< std::unique_ptr< T >> &v)
A utility function enabling the creation of a vector of pointers.
std::vector< Own< A > > VecOwn