Provides a central class to register globally used output streams. Currently supported streams are.
Definition StreamHandler.h:43
std::map< std::string, std::ostream * > name_to_stream_map_
Maps all registered stream names to the corresponding std::ostream.
Definition StreamHandler.h:113
std::ostream & getStream(StreamType const type, const std::string &stream_name)
Returns a reference to the stream of type type and with name stream_name.
std::ostream * createStream_(const StreamType type, const std::string &stream_name)
Creates a stream with the given type and the given name.
StreamHandler()
Default constructor.
void unregisterStream(StreamType const type, const std::string &stream_name)
De-registers a stream of type type and with name stream_name from the handler.
std::map< std::string, StreamType > name_to_type_map_
Maps all registered stream names to the corresponding StreamHandler::StreamType.
Definition StreamHandler.h:114
bool hasStream(const StreamType type, const std::string &stream_name)
Returns true if the stream stream_name with type type is registered.
friend std::ostream & operator<<(std::ostream &os, StreamHandler const &stream_handler)
Overload for the insertion operator (operator<<) to have a formatted output of the StreamHandler.
std::map< std::string, Size > name_to_counter_map_
Maps all registered stream names to the number of times it was registered. If the counter goes to zer...
Definition StreamHandler.h:115
StreamHandler(const StreamHandler &source)
copy constructor
StreamType
Defines the type of the stream that should be handled.
Definition StreamHandler.h:49
@ FILE
Definition StreamHandler.h:50
Int registerStream(StreamType const type, const std::string &stream_name)
Creates a stream of type type and with name stream_name.
virtual ~StreamHandler()
destructor
virtual StreamHandler & operator=(const StreamHandler &source)
assignment operator
int Int
Signed integer type.
Definition Types.h:72
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
StreamHandler STREAM_HANDLER
Global StreamHandler instance.