MeVisLab Toolbox Reference
|
Class to collect messages of different types. More...
#include <mlMessageCollector.h>
Public Member Functions | |
MessageCollector () | |
Construction with empty messages. More... | |
virtual | ~MessageCollector () |
Virtual destructor. More... | |
virtual bool | operator== (const MessageCollector &otherObj) |
Returns true on member equality, otherwise false. More... | |
virtual bool | hasInfo () const |
Returns true if the info member is not empty, otherwise false. More... | |
virtual void | appendInfo (const std::string &stringToAppend) |
Append an info string; can be overwritten for replacement of the appendInfo functionality. More... | |
virtual void | appendInfo (std::stringstream &streamToAppend) |
Append an info stream; indirectly uses appendInfo(const std::string &) for appending. More... | |
virtual void | setInfos (const std::string &stringToSet) |
Sets the current info string. More... | |
virtual void | setInfos (std::stringstream &streamToSet) |
Set an info stream. More... | |
virtual const std::string & | getInfos () const |
Get the current info string. More... | |
virtual void | postInfos (const std::string &funcName) |
If there are infos then they are posted with one call of ML_PRINT_INFO. More... | |
virtual bool | hasIssue () const |
Returns true if the issue member is not empty, otherwise false. More... | |
virtual void | appendIssue (const std::string &stringToAppend) |
Append an issue string; can be overwritten for replacement of the appendIssue functionality. More... | |
virtual void | appendIssue (std::stringstream &streamToAppend) |
Append an issue stream; indirectly uses appendIssue(const std::string &) for appending.. More... | |
virtual void | setIssues (const std::string &stringToSet) |
Sets the current issue string. More... | |
virtual void | setIssues (std::stringstream &streamToSet) |
Set an issue stream. More... | |
virtual const std::string & | getIssues () const |
Get the current issue string. More... | |
virtual void | postIssues (const std::string &funcName, const std::string &reason) |
If there are issues then they are posted with one call of ML_PRINT_WARNING. More... | |
virtual bool | hasError () const |
Returns true if error messaqe member is not empty, otherwise false. More... | |
virtual void | appendError (const std::string &stringToAppend) |
Append an error string; can be overwritten for replacement of the appendError functionality. More... | |
virtual void | appendError (std::stringstream &streamToAppend) |
Append an error stream; indirectly uses appendError(const std::string &) for appending.. More... | |
virtual void | setErrors (const std::string &stringToSet) |
Sets the current error string. More... | |
virtual void | setErrors (std::stringstream &streamToSet) |
Set an error stream. More... | |
virtual const std::string & | getErrors () const |
Get the current error string. More... | |
virtual void | postErrors (const std::string &funcName, const std::string &reason) |
If there are errors then they are posted with one call of ML_PRINT_ERROR. More... | |
virtual bool | hasMessages () const |
Returns true if any message is not empty, otherwise false. More... | |
virtual std::string | getAllMessages () const |
Get the current message + issue + error string. More... | |
virtual void | clearMessages () |
Clears all messages to empty strings, the handle is not changed. More... | |
virtual void | postMessages (const std::string &funcName, const std::string &reason) |
If there are any messages then post them with their appropriate post methods. More... | |
virtual void | convertAllMessagesToErrors () |
Append all messages to error messages and then clears them. More... | |
virtual void | appendMessagesFrom (const MessageCollector &other) |
Append all corresponding messages from other. More... | |
std::string | getFiltered (const std::string &stringToFilter) const |
Returns an empty string if _filterMatches returns true, otherwise stringToFilter is returned; otherwise it returns an empty string. More... | |
virtual MessageCollector * | createClone () |
Create a duplicate from *this. More... | |
Protected Member Functions | |
virtual bool | _filterMatches (const std::string &) const |
A filter method just returning false in this class; derived classes may implement filters reacting with other return values on message. More... | |
MessageCollector (const MessageCollector &)=default | |
Forbid copy constructor and assignment operator for others since often derived instances are passed; better use createClone(). More... | |
MessageCollector & | operator= (const MessageCollector &)=default |
Protected Attributes | |
std::string | _infos |
Collects any information. More... | |
std::string | _issues |
Collects issue information. More... | |
std::string | _errors |
Collects error information. More... | |
Class to collect messages of different types.
Definition at line 20 of file mlMessageCollector.h.
ml::MessageCollector::MessageCollector | ( | ) |
Construction with empty messages.
|
virtual |
Virtual destructor.
|
protecteddefault |
Forbid copy constructor and assignment operator for others since often derived instances are passed; better use createClone().
|
inlineprotectedvirtual |
A filter method just returning false in this class; derived classes may implement filters reacting with other return values on message.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
Definition at line 113 of file mlMessageCollector.h.
|
virtual |
Append an error string; can be overwritten for replacement of the appendError functionality.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
|
virtual |
Append an error stream; indirectly uses appendError(const std::string &) for appending..
|
virtual |
Append an info string; can be overwritten for replacement of the appendInfo functionality.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
|
virtual |
Append an info stream; indirectly uses appendInfo(const std::string &) for appending.
|
virtual |
Append an issue string; can be overwritten for replacement of the appendIssue functionality.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
|
virtual |
Append an issue stream; indirectly uses appendIssue(const std::string &) for appending..
|
virtual |
Append all corresponding messages from other.
|
virtual |
Clears all messages to empty strings, the handle is not changed.
|
virtual |
Append all messages to error messages and then clears them.
|
virtual |
Create a duplicate from *this.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted, and ml::DicomMessageCollector.
|
virtual |
Get the current message + issue + error string.
|
virtual |
Get the current error string.
std::string ml::MessageCollector::getFiltered | ( | const std::string & | stringToFilter | ) | const |
Returns an empty string if _filterMatches returns true, otherwise stringToFilter is returned; otherwise it returns an empty string.
|
virtual |
Get the current info string.
|
virtual |
Get the current issue string.
|
virtual |
Returns true if error messaqe member is not empty, otherwise false.
|
virtual |
Returns true if the info member is not empty, otherwise false.
|
virtual |
Returns true if the issue member is not empty, otherwise false.
|
virtual |
Returns true if any message is not empty, otherwise false.
|
protecteddefault |
|
virtual |
Returns true on member equality, otherwise false.
|
virtual |
If there are errors then they are posted with one call of ML_PRINT_ERROR.
funcName | The String to be used as FUNC_NAME parameter for the ML_PRINT_ERROR macro. |
reason | The String to be used as REASON parameter for the ML_PRINT_ERROR macro. |
|
virtual |
If there are infos then they are posted with one call of ML_PRINT_INFO.
funcName | The String to be used as FUNC_NAME parameter for the ML_PRINT_INFO macro. |
|
virtual |
If there are issues then they are posted with one call of ML_PRINT_WARNING.
funcName | The String to be used as FUNC_NAME parameter for the ML_PRINT_WARNING macro. |
reason | The String to be used as REASON parameter for the ML_PRINT_WARNING macro. |
|
virtual |
If there are any messages then post them with their appropriate post methods.
funcName | The String to be used as FUNC_NAME parameter for the ML_PRINT macro. |
reason | The String to be used as REASON parameter for the ML_PRINT macro. |
|
virtual |
Sets the current error string.
|
virtual |
Set an error stream.
|
virtual |
Sets the current info string.
|
virtual |
Set an info stream.
|
virtual |
Sets the current issue string.
|
virtual |
Set an issue stream.
|
protected |
Collects error information.
Definition at line 122 of file mlMessageCollector.h.
|
protected |
Collects any information.
Definition at line 116 of file mlMessageCollector.h.
|
protected |
Collects issue information.
Definition at line 119 of file mlMessageCollector.h.