souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
souffle::WriteFileCSV Class Reference

#include <WriteStreamCSV.h>

Inheritance diagram for souffle::WriteFileCSV:
Inheritance graph
Collaboration diagram for souffle::WriteFileCSV:
Collaboration graph

Public Member Functions

 WriteFileCSV (const std::map< std::string, std::string > &rwOperation, const SymbolTable &symbolTable, const RecordTable &recordTable)
 
 ~WriteFileCSV () override=default
 
- Public Member Functions inherited from souffle::WriteStream
template<typename T >
void writeAll (const T &relation)
 
template<>
void writeNext (const RamDomain *tuple)
 
template<typename T >
void writeSize (const T &relation)
 
 WriteStream (const std::map< std::string, std::string > &rwOperation, const SymbolTable &symbolTable, const RecordTable &recordTable)
 
- Public Member Functions inherited from souffle::SerialisationStream< true >
virtual ~SerialisationStream ()=default
 

Protected Member Functions

void writeNextTuple (const RamDomain *tuple) override
 
void writeNullary () override
 
- Protected Member Functions inherited from souffle::WriteStreamCSV
void writeNextTupleCSV (std::ostream &destination, const RamDomain *tuple)
 
void writeNextTupleElement (std::ostream &destination, const std::string &type, RamDomain value)
 
 WriteStreamCSV (const std::map< std::string, std::string > &rwOperation, const SymbolTable &symbolTable, const RecordTable &recordTable)
 
- Protected Member Functions inherited from souffle::WriteStream
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 writeSize (std::size_t)
 
- Protected Member Functions inherited from souffle::SerialisationStream< true >
 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)
 

Static Protected Member Functions

static std::string getFileName (const std::map< std::string, std::string > &rwOperation)
 Return given filename or construct from relation name. More...
 

Protected Attributes

std::ofstream file
 
- Protected Attributes inherited from souffle::WriteStreamCSV
const std::string delimiter
 
- Protected Attributes inherited from souffle::WriteStream
const bool summary
 
- Protected Attributes inherited from souffle::SerialisationStream< true >
size_t arity
 
size_t auxiliaryArity
 
RO< RecordTable > & recordTable
 
RO< SymbolTable > & symbolTable
 
std::vector< std::string > typeAttributes
 
Json types
 

Additional Inherited Members

- Protected Types inherited from souffle::SerialisationStream< true >
using RO = std::conditional_t< readOnlyTables, const A, A >
 

Detailed Description

Definition at line 77 of file WriteStreamCSV.h.

Constructor & Destructor Documentation

◆ WriteFileCSV()

souffle::WriteFileCSV::WriteFileCSV ( const std::map< std::string, std::string > &  rwOperation,
const SymbolTable symbolTable,
const RecordTable recordTable 
)
inline

Definition at line 79 of file WriteStreamCSV.h.

79  {
80  file << rwOperation.at("attributeNames") << std::endl;
81  }
82  file << std::setprecision(std::numeric_limits<RamFloat>::max_digits10);
83  }
84 
85  ~WriteFileCSV() override = default;
86 
87 protected:

References file.

◆ ~WriteFileCSV()

souffle::WriteFileCSV::~WriteFileCSV ( )
overridedefault

Member Function Documentation

◆ getFileName()

static std::string souffle::WriteFileCSV::getFileName ( const std::map< std::string, std::string > &  rwOperation)
inlinestaticprotected

Return given filename or construct from relation name.

Default name is [configured path]/[relation name].csv

Parameters
rwOperationmap of IO configuration options
Returns
input filename

Definition at line 109 of file WriteStreamCSV.h.

115  : public WriteStreamCSV {

◆ writeNextTuple()

void souffle::WriteFileCSV::writeNextTuple ( const RamDomain tuple)
inlineoverrideprotectedvirtual

Implements souffle::WriteStream.

Definition at line 98 of file WriteStreamCSV.h.

References souffle::getOr().

Here is the call graph for this function:

◆ writeNullary()

void souffle::WriteFileCSV::writeNullary ( )
inlineoverrideprotectedvirtual

Implements souffle::WriteStream.

Definition at line 94 of file WriteStreamCSV.h.

94  {
95  writeNextTupleCSV(file, tuple);
96  }

References file, and souffle::WriteStreamCSV::writeNextTupleCSV().

Here is the call graph for this function:

Field Documentation

◆ file

std::ofstream souffle::WriteFileCSV::file
protected

Definition at line 92 of file WriteStreamCSV.h.

Referenced by WriteFileCSV(), and writeNullary().


The documentation for this class was generated from the following file:
souffle::WriteStreamCSV::WriteStreamCSV
WriteStreamCSV(const std::map< std::string, std::string > &rwOperation, const SymbolTable &symbolTable, const RecordTable &recordTable)
Definition: WriteStreamCSV.h:46
souffle::WriteFileCSV::~WriteFileCSV
~WriteFileCSV() override=default
souffle::WriteStreamCSV::writeNextTupleCSV
void writeNextTupleCSV(std::ostream &destination, const RamDomain *tuple)
Definition: WriteStreamCSV.h:53
souffle::WriteFileCSV::file
std::ofstream file
Definition: WriteStreamCSV.h:92