Provides a central class to register globally used output streams. Currently supported streams are.
Definition: StreamHandler.h:43
StreamHandler()
Default constructor.
Int registerStream(StreamType const type, const String &stream_name)
Creates a stream of type type and with name stream_name.
std::ostream & getStream(StreamType const type, const String &stream_name)
Returns a reference to the stream of type type and with name stream_name.
std::ostream * createStream_(const StreamType type, const String &stream_name)
Creates a stream with the given type and the given name.
void unregisterStream(StreamType const type, const String &stream_name)
De-registers a stream of type type and with name stream_name from the handler.
std::map< String, StreamType > name_to_type_map_
Maps all registered stream names to the corresponding StreamHandler::StreamType.
Definition: StreamHandler.h:114
std::map< 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
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.
virtual StreamHandler & operator=(const StreamHandler &source)
assignment operator
StreamHandler(const StreamHandler &source)
copy constructor
std::map< String, std::ostream * > name_to_stream_map_
Maps all registered stream names to the corresponding std::ostream.
Definition: StreamHandler.h:113
StreamType
Defines the type of the stream that should be handled.
Definition: StreamHandler.h:49
@ FILE
Definition: StreamHandler.h:50
bool hasStream(const StreamType type, const String &stream_name)
Returns true if the stream stream_name with type type is registered.
virtual ~StreamHandler()
destructor
A more convenient string class.
Definition: String.h:34
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.