#include <WriteStream.h>
|
void | outputADT (std::ostream &destination, const RamDomain value, const std::string &name) |
|
void | outputRecord (std::ostream &destination, const RamDomain value, const std::string &name) |
|
template<typename Tuple > |
void | writeNext (const Tuple tuple) |
|
virtual void | writeNextTuple (const RamDomain *tuple)=0 |
|
virtual void | writeNullary ()=0 |
|
virtual void | writeSize (std::size_t) |
|
| SerialisationStream (RO< SymbolTable > &symTab, RO< RecordTable > &recTab, const std::map< std::string, std::string > &rwOperation) |
|
| SerialisationStream (RO< SymbolTable > &symTab, RO< RecordTable > &recTab, Json types) |
|
| SerialisationStream (RO< SymbolTable > &symTab, RO< RecordTable > &recTab, Json types, std::vector< std::string > relTypes, size_t auxArity=0) |
|
|
using | RO = std::conditional_t< readOnlyTables, const A, A > |
|
Definition at line 38 of file WriteStream.h.
◆ WriteStream()
souffle::WriteStream::WriteStream |
( |
const std::map< std::string, std::string > & |
rwOperation, |
|
|
const SymbolTable & |
symbolTable, |
|
|
const RecordTable & |
recordTable |
|
) |
| |
|
inline |
◆ outputADT()
void souffle::WriteStream::outputADT |
( |
std::ostream & |
destination, |
|
|
const RamDomain |
value, |
|
|
const std::string & |
name |
|
) |
| |
|
inlineprotected |
Definition at line 124 of file WriteStream.h.
142 branchId = tuplePtr[0];
143 branchInfo = adtInfo[
"branches"][branchId];
144 branchTypes = branchInfo[
"types"].array_items();
148 if (branchTypes.size() > 1) {
149 return recordTable.unpack(tuplePtr[1], branchTypes.size());
155 branchInfo = adtInfo[
"branches"][branchId];
156 branchTypes = branchInfo[
"types"].array_items();
159 destination <<
"$" << branchInfo[
"name"].string_value();
161 if (branchTypes.size() > 0) {
166 for (
size_t i = 0;
i < branchTypes.size(); ++
i) {
171 auto argType = branchTypes[
i].string_value();
172 switch (argType[0]) {
173 case 'i': destination << branchArgs[
i];
break;
174 case 'f': destination << ramBitCast<RamFloat>(branchArgs[
i]);
break;
175 case 'u': destination << ramBitCast<RamUnsigned>(branchArgs[
i]);
break;
176 case 's': destination <<
symbolTable.unsafeResolve(branchArgs[
i]);
break;
177 case 'r':
outputRecord(destination, branchArgs[
i], argType);
break;
178 case '+':
outputADT(destination, branchArgs[
i], argType);
break;
179 default:
fatal(
"Unsupported type attribute: `%c`", argType[0]);
183 if (branchTypes.size() > 0) {
189 class WriteStreamFactory {
◆ outputRecord()
void souffle::WriteStream::outputRecord |
( |
std::ostream & |
destination, |
|
|
const RamDomain |
value, |
|
|
const std::string & |
name |
|
) |
| |
|
inlineprotected |
Definition at line 83 of file WriteStream.h.
91 auto&& recordTypes = recordInfo[
"types"];
92 const size_t recordArity = recordInfo[
"arity"].long_value();
99 for (
size_t i = 0;
i < recordArity; ++
i) {
104 const std::string& recordType = recordTypes[
i].string_value();
107 switch (recordType[0]) {
108 case 'i': destination << recordValue;
break;
109 case 'f': destination << ramBitCast<RamFloat>(recordValue);
break;
110 case 'u': destination << ramBitCast<RamUnsigned>(recordValue);
break;
111 case 's': destination <<
symbolTable.unsafeResolve(recordValue);
break;
112 case 'r':
outputRecord(destination, recordValue, recordType);
break;
113 case '+':
outputADT(destination, recordValue, recordType);
break;
114 default:
fatal(
"Unsupported type attribute: `%c`", recordType[0]);
120 void outputADT(std::ostream& destination,
const RamDomain value,
const std::string& name) {
121 auto&& adtInfo =
types[
"ADTs"][name];
◆ writeAll()
template<typename T >
void souffle::WriteStream::writeAll |
( |
const T & |
relation | ) |
|
|
inline |
◆ writeNext() [1/2]
template<>
void souffle::WriteStream::writeNext |
( |
const RamDomain * |
tuple | ) |
|
|
inline |
◆ writeNext() [2/2]
template<typename Tuple >
void souffle::WriteStream::writeNext |
( |
const Tuple |
tuple | ) |
|
|
inlineprotected |
◆ writeNextTuple()
virtual void souffle::WriteStream::writeNextTuple |
( |
const RamDomain * |
tuple | ) |
|
|
protectedpure virtual |
◆ writeNullary()
virtual void souffle::WriteStream::writeNullary |
( |
| ) |
|
|
protectedpure virtual |
◆ writeSize() [1/2]
template<typename T >
void souffle::WriteStream::writeSize |
( |
const T & |
relation | ) |
|
|
inline |
◆ writeSize() [2/2]
virtual void souffle::WriteStream::writeSize |
( |
std::size_t |
| ) |
|
|
inlineprotectedvirtual |
◆ summary
const bool souffle::WriteStream::summary |
|
protected |
The documentation for this class was generated from the following file: