souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Attributes | Private Attributes
souffle::profile::Rule Class Reference

#include <Rule.h>

Collaboration diagram for souffle::profile::Rule:
Collaboration graph

Public Member Functions

void addAtomFrequency (const std::string &subruleName, std::string atom, size_t level, size_t frequency)
 
const std::set< Atom > & getAtoms () const
 
std::chrono::microseconds getEndtime () const
 
std::string getId () const
 
std::string getLocator () const
 
std::string getName () const
 
std::chrono::microseconds getRuntime () const
 
std::chrono::microseconds getStarttime () const
 
int getVersion () const
 
bool isRecursive () const
 
 Rule (std::string name, int version, std::string id)
 
 Rule (std::string name, std::string id)
 
void setEndtime (std::chrono::microseconds time)
 
void setId (std::string id)
 
void setLocator (std::string locator)
 
void setNumTuples (long numTuples)
 
void setRecursive (bool recursive)
 
void setStarttime (std::chrono::microseconds time)
 
void setVersion (int version)
 
long size ()
 
std::string toString () const
 

Protected Attributes

std::set< Atomatoms
 
std::chrono::microseconds endtime {}
 
std::string identifier
 
std::string locator {}
 
const std::string name
 
long numTuples {0}
 
std::chrono::microseconds starttime {}
 

Private Attributes

bool recursive = false
 
int version = 0
 

Detailed Description

Definition at line 47 of file Rule.h.

Constructor & Destructor Documentation

◆ Rule() [1/2]

souffle::profile::Rule::Rule ( std::string  name,
std::string  id 
)
inline

Definition at line 62 of file Rule.h.

62 : name(std::move(name)), identifier(std::move(id)) {}

◆ Rule() [2/2]

souffle::profile::Rule::Rule ( std::string  name,
int  version,
std::string  id 
)
inline

Definition at line 64 of file Rule.h.

65  : name(std::move(name)), identifier(std::move(id)), recursive(true), version(version) {}

Member Function Documentation

◆ addAtomFrequency()

void souffle::profile::Rule::addAtomFrequency ( const std::string &  subruleName,
std::string  atom,
size_t  level,
size_t  frequency 
)
inline

Definition at line 99 of file Rule.h.

99  {
100  atoms.emplace(atom, subruleName, level, frequency);
101  }

References atoms.

◆ getAtoms()

const std::set<Atom>& souffle::profile::Rule::getAtoms ( ) const
inline

Definition at line 103 of file Rule.h.

103  {
104  return atoms;
105  }

References atoms.

◆ getEndtime()

std::chrono::microseconds souffle::profile::Rule::getEndtime ( ) const
inline

Definition at line 79 of file Rule.h.

79  {
80  return endtime;
81  }

References endtime.

◆ getId()

std::string souffle::profile::Rule::getId ( ) const
inline

Definition at line 67 of file Rule.h.

67  {
68  return identifier;
69  }

References identifier.

◆ getLocator()

std::string souffle::profile::Rule::getLocator ( ) const
inline

Definition at line 114 of file Rule.h.

114  {
115  return locator;
116  }

References locator.

◆ getName()

std::string souffle::profile::Rule::getName ( ) const
inline

Definition at line 106 of file Rule.h.

106  {
107  return name;
108  }

References name.

◆ getRuntime()

std::chrono::microseconds souffle::profile::Rule::getRuntime ( ) const
inline

Definition at line 71 of file Rule.h.

71  {
72  return endtime - starttime;
73  }

References endtime, and starttime.

Referenced by toString().

◆ getStarttime()

std::chrono::microseconds souffle::profile::Rule::getStarttime ( ) const
inline

Definition at line 75 of file Rule.h.

75  {
76  return starttime;
77  }

References starttime.

◆ getVersion()

int souffle::profile::Rule::getVersion ( ) const
inline

Definition at line 130 of file Rule.h.

130  {
131  return version;
132  }

References version.

◆ isRecursive()

bool souffle::profile::Rule::isRecursive ( ) const
inline

Definition at line 122 of file Rule.h.

122  {
123  return recursive;
124  }

References recursive.

◆ setEndtime()

void souffle::profile::Rule::setEndtime ( std::chrono::microseconds  time)
inline

Definition at line 91 of file Rule.h.

91  {
92  endtime = time;
93  }

References endtime, and souffle::test::time().

Here is the call graph for this function:

◆ setId()

void souffle::profile::Rule::setId ( std::string  id)
inline

Definition at line 110 of file Rule.h.

110  {
111  identifier = id;
112  }

References id(), and identifier.

Here is the call graph for this function:

◆ setLocator()

void souffle::profile::Rule::setLocator ( std::string  locator)
inline

Definition at line 118 of file Rule.h.

118  {
119  this->locator = locator;
120  }

References locator.

◆ setNumTuples()

void souffle::profile::Rule::setNumTuples ( long  numTuples)
inline

Definition at line 95 of file Rule.h.

95  {
96  this->numTuples = numTuples;
97  }

References numTuples.

◆ setRecursive()

void souffle::profile::Rule::setRecursive ( bool  recursive)
inline

Definition at line 126 of file Rule.h.

126  {
127  this->recursive = recursive;
128  }

References recursive.

◆ setStarttime()

void souffle::profile::Rule::setStarttime ( std::chrono::microseconds  time)
inline

Definition at line 87 of file Rule.h.

87  {
88  starttime = time;
89  }

References starttime, and souffle::test::time().

Here is the call graph for this function:

◆ setVersion()

void souffle::profile::Rule::setVersion ( int  version)
inline

Definition at line 134 of file Rule.h.

134  {
135  this->version = version;
136  }

References version.

◆ size()

long souffle::profile::Rule::size ( )
inline

Definition at line 83 of file Rule.h.

83  {
84  return numTuples;
85  }

References numTuples.

◆ toString()

std::string souffle::profile::Rule::toString ( ) const
inline

Definition at line 138 of file Rule.h.

138  {
139  std::ostringstream output;
140  if (recursive) {
141  output << "{" << name << "," << version << ":";
142  } else {
143  output << "{" << name << ":";
144  }
145  output << "[" << getRuntime().count() << "," << numTuples << "]}";
146  return output.str();
147  }

References getRuntime(), name, numTuples, recursive, and version.

Here is the call graph for this function:

Field Documentation

◆ atoms

std::set<Atom> souffle::profile::Rule::atoms
protected

Definition at line 55 of file Rule.h.

Referenced by addAtomFrequency(), and getAtoms().

◆ endtime

std::chrono::microseconds souffle::profile::Rule::endtime {}
protected

Definition at line 51 of file Rule.h.

Referenced by getEndtime(), getRuntime(), and setEndtime().

◆ identifier

std::string souffle::profile::Rule::identifier
protected

Definition at line 53 of file Rule.h.

Referenced by getId(), and setId().

◆ locator

std::string souffle::profile::Rule::locator {}
protected

Definition at line 54 of file Rule.h.

Referenced by getLocator(), and setLocator().

◆ name

const std::string souffle::profile::Rule::name
protected

Definition at line 49 of file Rule.h.

Referenced by getName(), and toString().

◆ numTuples

long souffle::profile::Rule::numTuples {0}
protected

Definition at line 52 of file Rule.h.

Referenced by setNumTuples(), size(), and toString().

◆ recursive

bool souffle::profile::Rule::recursive = false
private

Definition at line 58 of file Rule.h.

Referenced by isRecursive(), setRecursive(), and toString().

◆ starttime

std::chrono::microseconds souffle::profile::Rule::starttime {}
protected

Definition at line 50 of file Rule.h.

Referenced by getRuntime(), getStarttime(), and setStarttime().

◆ version

int souffle::profile::Rule::version = 0
private

Definition at line 59 of file Rule.h.

Referenced by getVersion(), setVersion(), and toString().


The documentation for this class was generated from the following file:
souffle::profile::Rule::locator
std::string locator
Definition: Rule.h:54
souffle::profile::Rule::endtime
std::chrono::microseconds endtime
Definition: Rule.h:51
souffle::profile::Rule::getRuntime
std::chrono::microseconds getRuntime() const
Definition: Rule.h:71
souffle::profile::Rule::numTuples
long numTuples
Definition: Rule.h:52
souffle::profile::Rule::atoms
std::set< Atom > atoms
Definition: Rule.h:55
souffle::profile::Rule::recursive
bool recursive
Definition: Rule.h:58
souffle::test::time
long time(const std::string &name, const Op &operation)
Definition: btree_multiset_test.cpp:411
souffle::ast::DirectiveType::output
@ output
souffle::profile::Rule::version
int version
Definition: Rule.h:59
souffle::profile::Rule::name
const std::string name
Definition: Rule.h:49
id
void id(std::string col)
Definition: Tui.h:1124
souffle::profile::Rule::starttime
std::chrono::microseconds starttime
Definition: Rule.h:50
souffle::profile::Rule::identifier
std::string identifier
Definition: Rule.h:53