Class xlifepp::PrintStream#

class PrintStream#

Collaboration diagram for xlifepp::PrintStream:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "3" [label="std::basic_string< char >" tooltip="std::basic_string< char >"] "4" [label="std::basic_string< Char >" tooltip="std::basic_string< Char >"] "2" [label="std::string" tooltip="std::string"] "6" [label="std::vector< T >" tooltip="std::vector< T >"] "7" [label="std::vector< number_t >" tooltip="std::vector< number_t >"] "5" [label="std::vector< std::ofstream * >" tooltip="std::vector< std::ofstream * >"] "1" [label="xlifepp::PrintStream" tooltip="xlifepp::PrintStream" fillcolor="#BFBFBF"] "3" -> "4" [dir=forward tooltip="template-instance"] "2" -> "3" [dir=forward tooltip="public-inheritance"] "7" -> "6" [dir=forward tooltip="template-instance"] "5" -> "6" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="usage"] "1" -> "5" [dir=forward tooltip="usage"] "1" -> "7" [dir=forward tooltip="usage"] }

PrintSream class encapsulates multiple std::ofstream objects allowing to print result of threads on different ofstream it there is only one thread available, print as usual in a single file.

Construct such object from one name file, e.g print.txt then the following file will be created print.txt for thread 0 or no multithreading print1.txt for thread 1 print2.txt for thread 2 …

PrintSream inherits from std::ostream and can be used as ordinary stream, for instance PrintStream thePrintStream(“print.txt”); thePrintStream << “toto “<<i<<…

Public Members

std::string name#

root name of files

bool notOpen#

open status

std::vector<std::ofstream*> ofstreams#

file stream pointers

std::vector<number_t> tps#

initial lengths of files