NDEVR
API Documentation
LogStreamabstract

A listener that receives and processes log messages and progress updates from an InfoPipe. More...

Inheritance diagram for LogStream:
[legend]
Collaboration diagram for LogStream:
[legend]

Public Member Functions

virtual ~LogStream ()
 Destructor.
virtual void addMessage (uint04 id, const LogMessage &message)=0
 Adds a single log message to this stream.
virtual void addMessages (uint04 id, const Buffer< LogMessage > &messages)
 Adds multiple log messages to this stream at once.
virtual void addProgressSource (const TranslatedString &name, uint04 idx, fltp04 progress)
 Registers a new progress source to be tracked by this stream.
virtual void allowCancel (bool)
 Sets whether this stream allows the user to cancel an in-progress operation.
virtual void allowInput (bool)
 Sets whether this stream allows user input during an operation.
virtual void attach (InfoPipe *stream)
 Attaches this LogStream to the given InfoPipe so it receives log updates.
void clearLinks ()
 Detaches this LogStream from all linked InfoPipe objects and clears the link list.
virtual void detach (InfoPipe *stream)
 Detaches this LogStream from the given InfoPipe, stopping further updates from it.
bool ignoringMessages () const
 Returns whether this stream is currently ignoring messages.
virtual void removeProgressSource (uint04 idx)
 Removes a previously registered progress source from this stream.
void setIgnoreMessages (bool ignore)
 Sets whether this stream should ignore incoming messages.
virtual void setProgress (uint04 id, fltp04 progress)=0
 Updates the progress value for a tracked operation.

Protected Attributes

bool m_ignore_message = false
 Whether this stream should ignore incoming messages.
Buffer< InfoPipe * > m_linked_logs
 Collection of InfoPipe objects this stream is listening to.
Dictionary< uint04, ProgressSourcem_progress_sources
 Maps progress source indices to their ProgressSource data.

Detailed Description

A listener that receives and processes log messages and progress updates from an InfoPipe.


See also
LogManager, STDOutputStream, DebugStream, ProgressWidget

Definition at line 48 of file LogStream.h.

Constructor & Destructor Documentation

◆ ~LogStream()

virtual LogStream::~LogStream ( )
inlinevirtual

Destructor.

Clears all linked InfoPipe connections before destruction.

Definition at line 54 of file LogStream.h.

References clearLinks().

Member Function Documentation

◆ addMessage()

virtual void LogStream::addMessage ( uint04 id,
const LogMessage & message )
pure virtual

Adds a single log message to this stream.

Parameters
[in]idThe identifier associated with the message source.
[in]messageThe log message to add.

Implemented in AsciiFileOutputStream, BuildActionDefinition, ConnectionPipeStream, ConnectionStatusWidget, DebugStream, LogView, ProgressWidget, StatusBar, STDOutputStream, and TerminalDialog.

Referenced by addMessages().

◆ addMessages()

virtual void LogStream::addMessages ( uint04 id,
const Buffer< LogMessage > & messages )
inlinevirtual

Adds multiple log messages to this stream at once.

Parameters
[in]idThe identifier associated with the message source.
[in]messagesThe buffer of log messages to add.

Reimplemented in AsciiFileOutputStream, and LogView.

Definition at line 119 of file LogStream.h.

References addMessage().

◆ addProgressSource()

virtual void LogStream::addProgressSource ( const TranslatedString & name,
uint04 idx,
fltp04 progress )
inlinevirtual

Registers a new progress source to be tracked by this stream.

Parameters
[in]nameThe display name of the progress source.
[in]idxThe unique index identifying the progress source.
[in]progressThe initial progress value for this source.

Definition at line 102 of file LogStream.h.

References m_progress_sources, and name.

◆ allowCancel()

virtual void LogStream::allowCancel ( bool )
inlinevirtual

Sets whether this stream allows the user to cancel an in-progress operation.

Parameters
[in]allowWhether cancellation is allowed.

Reimplemented in LogView, and StatusBar.

Definition at line 78 of file LogStream.h.

◆ allowInput()

virtual void LogStream::allowInput ( bool )
inlinevirtual

Sets whether this stream allows user input during an operation.

Parameters
[in]allowWhether input is allowed.

Definition at line 83 of file LogStream.h.

◆ attach()

virtual void LogStream::attach ( InfoPipe * stream)
inlinevirtual

Attaches this LogStream to the given InfoPipe so it receives log updates.

Parameters
[in]streamThe InfoPipe to listen to.

Reimplemented in LogView.

Definition at line 62 of file LogStream.h.

References m_linked_logs.

◆ detach()

virtual void LogStream::detach ( InfoPipe * stream)
inlinevirtual

Detaches this LogStream from the given InfoPipe, stopping further updates from it.

Parameters
[in]streamThe InfoPipe to stop listening to.

Definition at line 70 of file LogStream.h.

References m_linked_logs.

◆ ignoringMessages()

bool LogStream::ignoringMessages ( ) const
inline

Returns whether this stream is currently ignoring messages.

Returns
True if messages are being ignored, false otherwise.

Definition at line 147 of file LogStream.h.

References m_ignore_message.

◆ removeProgressSource()

virtual void LogStream::removeProgressSource ( uint04 idx)
inlinevirtual

Removes a previously registered progress source from this stream.

Parameters
[in]idxThe unique index of the progress source to remove.

Definition at line 110 of file LogStream.h.

References m_progress_sources.

◆ setIgnoreMessages()

void LogStream::setIgnoreMessages ( bool ignore)
inline

Sets whether this stream should ignore incoming messages.

Parameters
[in]ignoreIf true, messages will be ignored.

Definition at line 139 of file LogStream.h.

References m_ignore_message.

◆ setProgress()

virtual void LogStream::setProgress ( uint04 id,
fltp04 progress )
pure virtual

Updates the progress value for a tracked operation.

Parameters
[in]idThe identifier of the progress operation.
[in]progressThe current progress value, typically in the range [0, 1].

Implemented in AsciiFileOutputStream, BuildActionDefinition, ConnectionPipeStream, ConnectionStatusWidget, DebugStream, LogView, ProgressWidget, StatusBar, STDOutputStream, and TerminalDialog.


The documentation for this class was generated from the following file: