Program Listing for File TextOutput.h

Return to documentation for file (include/crpropa/module/TextOutput.h)

#ifndef CRPROPA_TEXTOUTPUT_H
#define CRPROPA_TEXTOUTPUT_H

#include "crpropa/module/Output.h"
#include "crpropa/module/ParticleCollector.h"

#include <fstream>

namespace crpropa {
class TextOutput: public Output {
protected:
        std::ostream *out;
        std::ofstream outfile;
        std::string filename;
        bool storeRandomSeeds;

        void printHeader() const;

public:
        TextOutput();
        TextOutput(OutputType outputType);
        TextOutput(std::ostream &out);
        TextOutput(std::ostream &out, OutputType outputType);
        TextOutput(const std::string &filename);
        TextOutput(const std::string &filename, OutputType outputType);
        ~TextOutput();
        void enableRandomSeeds() {storeRandomSeeds = true;};
        void close();
        void gzip();
        void process(Candidate *candidate) const;
        static void load(const std::string &filename, ParticleCollector *collector);
        std::string getDescription() const;
};
} // namespace crpropa

#endif // CRPROPA_TEXTOUTPUT_H