souffle
2.0.2-371-g6315b36
|
Go to the documentation of this file.
71 body = std::move(bodyLiterals);
79 for (
auto& cur :
body) {
80 res.push_back(cur.get());
98 for (
auto& cur :
body) {
99 cur =
map(std::move(cur));
112 void print(std::ostream& os)
const override {
117 os <<
" : { " <<
join(
body) <<
" }";
120 bool equal(
const Node& node)
const override {
121 const auto& other =
static_cast<const Aggregator&
>(node);
void setFinalType(AggregateOp newType)
std::vector< const Node * > getChildNodes() const override
Obtain a list of all embedded AST child nodes.
AggregateOp
Types of aggregation functions.
VecOwn< Literal > body
Body literal of sub-query.
An abstract class for manipulating AST Nodes by substitution.
AggregateOp baseOperator
Aggregate (base type) operator.
auto map(const std::vector< A > &xs, F &&f)
Applies a function to each element of a vector and returns the results.
bool equal(const Node &node) const override
Abstract equality check for two AST nodes.
An abstract class for arguments.
auto clone(const std::vector< A * > &xs)
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::optional< AggregateOp > finalTranslatorType
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...
void apply(const NodeMapper &map) override
Apply the mapper to all child nodes.
virtual std::vector< const Node * > getChildNodes() const
Obtain a list of all embedded AST child nodes.
auto copy(span< A, arity > s)
Abstract class for syntactic elements in an input program.
std::vector< Literal * > getBodyLiterals() const
Return body literals.
Defines the aggregator class.
Aggregator * clone() const override
Create clone.
AggregateOp getBaseOperator() const
Return the (base type) operator of the aggregator.
void print(std::ostream &os) const override
Output to a given output stream.
Own< Argument > targetExpression
Aggregate expression.
A class describing a range in an input file.
const Argument * getTargetExpression() const
Return target expression.
const SrcLocation & getSrcLoc() const
Return source location of the Node.
std::optional< AggregateOp > getFinalType() const
void setBody(VecOwn< Literal > bodyLiterals)
Set body.
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
Aggregator(AggregateOp baseOperator, Own< Argument > expr=nullptr, VecOwn< Literal > body={}, SrcLocation loc={})