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

Execution time logger for a statement. More...

#include <LogRelationTimer.h>

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

Public Member Functions

void apply (const NodeMapper &map) override
 Apply the mapper to all child nodes. More...
 
LogRelationTimerclone () const override
 Create a clone (i.e. More...
 
std::vector< const Node * > getChildNodes () const override
 Obtain list of all embedded child nodes. More...
 
 LogRelationTimer (Own< Statement > stmt, std::string msg, std::string relRef)
 
- Public Member Functions inherited from souffle::ram::RelationStatement
const std::string & getRelation () const
 Get RAM relation. More...
 
 RelationStatement (std::string rel)
 
- 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
 
- Public Member Functions inherited from souffle::ram::AbstractLog
 AbstractLog (Own< Statement > stmt, std::string msg)
 
void apply (const NodeMapper &map)
 
std::vector< const Node * > getChildNodes () const
 
const std::string & getMessage () const
 Get logging message. More...
 
const StatementgetStatement () const
 Get logging statement. More...
 

Protected Member Functions

void print (std::ostream &os, int tabpos) const override
 Pretty print with indentation. More...
 
- Protected Member Functions inherited from souffle::ram::RelationStatement
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...
 
- Protected Member Functions inherited from souffle::ram::AbstractLog
bool equal (const Node &node) const
 

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...
 
- Protected Attributes inherited from souffle::ram::RelationStatement
std::string relation
 Relation. More...
 
- Protected Attributes inherited from souffle::ram::AbstractLog
const std::string message
 Logging message. More...
 
Own< Statementstatement
 Logging statement. More...
 

Detailed Description

Execution time logger for a statement.

Logs the execution time of a statement. Before and after the execution of the logging statement the wall-clock time is taken to compute the time duration for the statement. Duration and logging message is printed after the execution of the statement.

For example:

START_TIMER ON A "file.dl [8:1-8:8]\;"
...
END_TIMER

Definition at line 55 of file LogRelationTimer.h.

Constructor & Destructor Documentation

◆ LogRelationTimer()

souffle::ram::LogRelationTimer::LogRelationTimer ( Own< Statement stmt,
std::string  msg,
std::string  relRef 
)
inline

Definition at line 57 of file LogRelationTimer.h.

62  {

Member Function Documentation

◆ apply()

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

Apply the mapper to all child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 70 of file LogRelationTimer.h.

71  :
72  void print(std::ostream& os, int tabpos) const override {
73  os << times(" ", tabpos) << "START_TIMER ON " << relation << " \"" << stringify(message) << "\""

References souffle::ram::AbstractLog::message, souffle::ram::Statement::print(), souffle::ram::RelationStatement::relation, souffle::ram::AbstractLog::statement, souffle::stringify(), and souffle::times().

Here is the call graph for this function:

◆ clone()

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

Create a clone (i.e.

deep copy) of this node

Implements souffle::ram::Statement.

Definition at line 66 of file LogRelationTimer.h.

References souffle::ram::AbstractLog::apply(), souffle::ram::Node::apply(), and souffle::map().

Here is the call graph for this function:

◆ getChildNodes()

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

Obtain list of all embedded child nodes.

Reimplemented from souffle::ram::Node.

Definition at line 60 of file LogRelationTimer.h.

62  {
64  }

◆ print()

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

Pretty print with indentation.

Implements souffle::ram::Statement.

Definition at line 76 of file LogRelationTimer.h.


The documentation for this class was generated from the following file:
souffle::ram::LogRelationTimer::print
void print(std::ostream &os, int tabpos) const override
Pretty print with indentation.
Definition: LogRelationTimer.h:76
souffle::ram::Node::apply
virtual void apply(const NodeMapper &)
Apply the mapper to all child nodes.
Definition: Node.h:71
souffle::ram::RelationStatement::relation
std::string relation
Relation.
Definition: RelationStatement.h:54
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::AbstractLog::apply
void apply(const NodeMapper &map)
Definition: AbstractLog.h:59
souffle::ram::AbstractLog::message
const std::string message
Logging message.
Definition: AbstractLog.h:74
souffle::stringify
std::string stringify(const std::string &input)
Stringify a string using escapes for escape, newline, tab, double-quotes and semicolons.
Definition: StringUtil.h:334
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::LogRelationTimer::LogRelationTimer
LogRelationTimer(Own< Statement > stmt, std::string msg, std::string relRef)
Definition: LogRelationTimer.h:57
souffle::ram::AbstractLog::statement
Own< Statement > statement
Logging statement.
Definition: AbstractLog.h:71