MeVisLab Toolbox Reference
|
Class to collect messages of different types. More...
#include <mlMessageCollector.h>
Public Member Functions | |
MessageCollector () | |
Construction with empty messages. | |
virtual | ~MessageCollector () |
Virtual destructor. | |
bool | operator== (const MessageCollector &otherObj) const |
Returns true on member equality, otherwise false. | |
virtual bool | hasInfo () const |
Returns true if the info member is not empty, otherwise false. | |
virtual void | appendInfo (const std::string &stringToAppend) |
Append an info string; can be overwritten for replacement of the appendInfo functionality. | |
virtual void | appendInfo (std::stringstream &streamToAppend) |
Append an info stream; indirectly uses appendInfo(const std::string &) for appending. | |
virtual void | setInfos (const std::string &stringToSet) |
Sets the current info string. | |
virtual void | setInfos (std::stringstream &streamToSet) |
Set an info stream. | |
virtual const std::string & | getInfos () const |
Get the current info string. | |
virtual void | postInfos (const std::string &funcName) |
If there are infos then they are posted with one call of ML_PRINT_INFO. | |
virtual bool | hasIssue () const |
Returns true if the issue member is not empty, otherwise false. | |
virtual void | appendIssue (const std::string &stringToAppend) |
Append an issue string; can be overwritten for replacement of the appendIssue functionality. | |
virtual void | appendIssue (std::stringstream &streamToAppend) |
Append an issue stream; indirectly uses appendIssue(const std::string &) for appending.. | |
virtual void | setIssues (const std::string &stringToSet) |
Sets the current issue string. | |
virtual void | setIssues (std::stringstream &streamToSet) |
Set an issue stream. | |
virtual const std::string & | getIssues () const |
Get the current issue string. | |
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. | |
virtual bool | hasError () const |
Returns true if error messaqe member is not empty, otherwise false. | |
virtual void | appendError (const std::string &stringToAppend) |
Append an error string; can be overwritten for replacement of the appendError functionality. | |
virtual void | appendError (std::stringstream &streamToAppend) |
Append an error stream; indirectly uses appendError(const std::string &) for appending.. | |
virtual void | setErrors (const std::string &stringToSet) |
Sets the current error string. | |
virtual void | setErrors (std::stringstream &streamToSet) |
Set an error stream. | |
virtual const std::string & | getErrors () const |
Get the current error string. | |
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. | |
virtual bool | hasMessages () const |
Returns true if any message is not empty, otherwise false. | |
virtual std::string | getAllMessages () const |
Get the current message + issue + error string. | |
virtual void | clearMessages () |
Clears all messages to empty strings, the handle is not changed. | |
virtual void | postMessages (const std::string &funcName, const std::string &reason) |
If there are any messages then post them with their appropriate post methods. | |
virtual void | convertAllMessagesToErrors () |
Append all messages to error messages and then clears them. | |
virtual void | appendMessagesFrom (const MessageCollector &other) |
Append all corresponding messages from other. | |
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. | |
virtual MessageCollector * | createClone () |
Create a duplicate from *this. | |
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. | |
MessageCollector (const MessageCollector &)=default | |
Forbid copy constructor and assignment operator for others since often derived instances are passed; better use createClone(). | |
MessageCollector & | operator= (const MessageCollector &)=default |
Protected Attributes | |
std::string | _infos |
Collects any information. | |
std::string | _issues |
Collects issue information. | |
std::string | _errors |
Collects error information. | |
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.
Append an error string; can be overwritten for replacement of the appendError functionality.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
Append an error stream; indirectly uses appendError(const std::string &) for appending..
Append an info string; can be overwritten for replacement of the appendInfo functionality.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
Append an info stream; indirectly uses appendInfo(const std::string &) for appending.
Append an issue string; can be overwritten for replacement of the appendIssue functionality.
Reimplemented in ml::DicomConfigurableMessageFilterBaseRefCounted.
Append an issue stream; indirectly uses appendIssue(const std::string &) for appending..
|
virtual |
Append all corresponding messages from other.
Clears all messages to empty strings, the handle is not changed.
Append all messages to error messages and then clears them.
|
virtual |
Create a duplicate from *this.
Reimplemented in ml::DicomMessageCollector, and ml::DicomConfigurableMessageFilterBaseRefCounted.
|
virtual |
Get the current message + issue + error string.
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.
Get the current info string.
Get the current issue string.
Returns true if error messaqe member is not empty, otherwise false.
Returns true if the info member is not empty, otherwise false.
Returns true if the issue member is not empty, otherwise false.
Returns true if any message is not empty, otherwise false.
|
protecteddefault |
bool ml::MessageCollector::operator== | ( | const MessageCollector & | otherObj | ) | const |
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. |
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. |
Sets the current error string.
Set an error stream.
Sets the current info string.
Set an info stream.
Sets the current issue string.
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.