#include <Reader.h>
Definition at line 271 of file Reader.h.
◆ Reader() [1/2]
souffle::profile::Reader::Reader |
( |
std::string |
filename, |
|
|
std::shared_ptr< ProgramRun > |
run |
|
) |
| |
|
inline |
◆ Reader() [2/2]
souffle::profile::Reader::Reader |
( |
std::shared_ptr< ProgramRun > |
run | ) |
|
|
inline |
◆ addRelation()
void souffle::profile::Reader::addRelation |
( |
const DirectoryEntry & |
relation | ) |
|
|
inline |
◆ cleanRelationName()
std::string souffle::profile::Reader::cleanRelationName |
( |
const std::string & |
relationName | ) |
|
|
inlineprotected |
◆ createId()
std::string souffle::profile::Reader::createId |
( |
| ) |
|
|
inline |
◆ extractRelationNameFromAtom()
std::string souffle::profile::Reader::extractRelationNameFromAtom |
( |
const Atom & |
atom | ) |
|
|
inlineprotected |
◆ isLive()
bool souffle::profile::Reader::isLive |
( |
| ) |
|
|
inline |
◆ isLoaded()
bool souffle::profile::Reader::isLoaded |
( |
| ) |
|
|
inline |
◆ processFile()
void souffle::profile::Reader::processFile |
( |
| ) |
|
|
inline |
Read the contents from file into the class.
Definition at line 298 of file Reader.h.
301 auto programDuration =
dynamic_cast<DurationEntry*
>(
db.lookupEntry({
"program",
"runtime"}));
302 if (programDuration ==
nullptr) {
303 auto startTimeEntry =
dynamic_cast<TimeEntry*
>(
db.lookupEntry({
"program",
"starttime"}));
304 if (startTimeEntry !=
nullptr) {
305 run->setStarttime(startTimeEntry->getTime());
306 run->setEndtime(std::chrono::duration_cast<microseconds>(
now().time_since_epoch()));
309 run->setStarttime(programDuration->getStart());
310 run->setEndtime(programDuration->getEnd());
314 auto relations =
dynamic_cast<DirectoryEntry*
>(
db.lookupEntry({
"program",
"relation"}));
319 for (
const auto& cur :
relations->getKeys()) {
320 auto relation =
dynamic_cast<DirectoryEntry*
>(
db.lookupEntry({
"program",
"relation", cur}));
326 for (
const auto&
rule :
relation.second->getRuleMap()) {
327 for (
const auto& atom :
rule.second->getAtoms()) {
329 relationMap[relationName]->addReads(atom.frequency);
334 for (
const auto& atom :
rule.second->getAtoms()) {
336 if (relationName.substr(0, 6) ==
"@delta") {
337 relationName = relationName.substr(7);
339 assert(
relationMap.count(relationName) > 0 ||
"Relation name for atom not found");
340 relationMap[relationName]->addReads(atom.frequency);
345 run->setRelationMap(this->relationMap);
References addRelation(), db, extractRelationNameFromAtom(), iteration, loaded, souffle::now(), online, rel_id, relation, relationMap, relations, rule, and run.
◆ RelationcreateId()
std::string souffle::profile::Reader::RelationcreateId |
( |
| ) |
|
|
inline |
◆ save()
void souffle::profile::Reader::save |
( |
std::string |
f_name | ) |
|
◆ db
◆ file_loc
std::string souffle::profile::Reader::file_loc |
|
private |
◆ gpos
std::streampos souffle::profile::Reader::gpos |
|
private |
◆ loaded
bool souffle::profile::Reader::loaded = false |
|
private |
◆ online
bool souffle::profile::Reader::online {true} |
|
private |
◆ rel_id
int souffle::profile::Reader::rel_id {0} |
|
private |
◆ relationMap
std::unordered_map<std::string, std::shared_ptr<Relation> > souffle::profile::Reader::relationMap {} |
|
private |
◆ run
std::shared_ptr<ProgramRun> souffle::profile::Reader::run |
The documentation for this class was generated from the following file: