Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
MantidQt::MantidWidgets::Message Class Reference

Provides a simple binding of a text message with a priority. More...

#include <Message.h>

Inheritance diagram for MantidQt::MantidWidgets::Message:

Public Types

using Priority = Mantid::Kernel::Logger::Priority
 Priority matches Mantid Logger priority. More...
 

Public Member Functions

 Message ()
 Default constuctor required by Qt meta-type system. More...
 
 Message (const char *text, Priority priority=Priority::PRIO_NOTICE, const QString &scriptPath="")
 Construct a message from a c-style string and a given priority (default=notice) More...
 
 Message (const Message &msg)
 Copy constructor. More...
 
 Message (const std::string &text, Priority priority=Priority::PRIO_NOTICE, const QString &scriptPath="")
 Construct a message from a std::string with a given priority (default=notice) More...
 
 Message (QString text, Priority priority=Priority::PRIO_NOTICE, const QString &scriptPath="")
 Construct a message from a QString with a given priority (default=notice) More...
 
Messageoperator= (const Message &msg)
 Copy assignment. More...
 
Priority priority () const
 
QString scriptPath () const
 
void setScriptPath (const QString &scriptPath)
 Set the script name. This is useful if a script is renamed. More...
 
QString text () const
 

Private Attributes

Priority m_priority
 
QString m_scriptPath
 
QString m_text
 

Detailed Description

Provides a simple binding of a text message with a priority.

Definition at line 28 of file Message.h.

Member Typedef Documentation

◆ Priority

Priority matches Mantid Logger priority.

Definition at line 33 of file Message.h.

Constructor & Destructor Documentation

◆ Message() [1/5]

MantidQt::MantidWidgets::Message::Message ( )

Default constuctor required by Qt meta-type system.

Constructs a blank message with notice priority (here to satisfy Qt meta-type system)

Definition at line 22 of file Message.cpp.

◆ Message() [2/5]

MantidQt::MantidWidgets::Message::Message ( QString  text,
Priority  priority = Priority::PRIO_NOTICE,
const QString &  scriptPath = "" 
)

Construct a message from a QString with a given priority (default=notice)

Parameters
textA QString containing the message text
priorityAn enumeration indicating the priority
scriptPathThe path of the script the message originated from. Empty string if no script applicable

Definition at line 30 of file Message.cpp.

◆ Message() [3/5]

MantidQt::MantidWidgets::Message::Message ( const std::string &  text,
Priority  priority = Priority::PRIO_NOTICE,
const QString &  scriptPath = "" 
)

Construct a message from a std::string with a given priority (default=notice)

Parameters
textA std::string containing the message text
priorityAn enumeration indicating the priority
scriptPathThe path of the script the message originated from. Empty string if no script applicable

Definition at line 39 of file Message.cpp.

◆ Message() [4/5]

MantidQt::MantidWidgets::Message::Message ( const char *  text,
Priority  priority = Priority::PRIO_NOTICE,
const QString &  scriptPath = "" 
)

Construct a message from a c-style string and a given priority (default=notice)

Parameters
textA c-style string containing the message text
priorityAn enumeration indicating the priority
scriptPathThe path of the script the message originated from. Empty string if no script applicable

Definition at line 48 of file Message.cpp.

◆ Message() [5/5]

MantidQt::MantidWidgets::Message::Message ( const Message msg)

Copy constructor.

Construct a message from another object.

Definition at line 54 of file Message.cpp.

Member Function Documentation

◆ operator=()

Message & MantidQt::MantidWidgets::Message::operator= ( const Message msg)

Copy assignment.

Construct a message from another object through assignment.

Definition at line 60 of file Message.cpp.

References m_priority, m_scriptPath, m_text, priority(), scriptPath(), and text().

◆ priority()

Priority MantidQt::MantidWidgets::Message::priority ( ) const
inline
Returns
The message priority

Definition at line 54 of file Message.h.

Referenced by MantidQt::MantidWidgets::MessageDisplay::append(), and operator=().

◆ scriptPath()

QString MantidQt::MantidWidgets::Message::scriptPath ( ) const
inline
Returns
The name of the script the message came from

Definition at line 56 of file Message.h.

Referenced by operator=(), and MantidQt::MantidWidgets::MessageDisplay::shouldBeDisplayed().

◆ setScriptPath()

void MantidQt::MantidWidgets::Message::setScriptPath ( const QString &  scriptPath)
inline

Set the script name. This is useful if a script is renamed.

Definition at line 58 of file Message.h.

◆ text()

QString MantidQt::MantidWidgets::Message::text ( ) const
inline

Member Data Documentation

◆ m_priority

Priority MantidQt::MantidWidgets::Message::m_priority
private

Definition at line 62 of file Message.h.

Referenced by operator=().

◆ m_scriptPath

QString MantidQt::MantidWidgets::Message::m_scriptPath
private

Definition at line 63 of file Message.h.

Referenced by operator=().

◆ m_text

QString MantidQt::MantidWidgets::Message::m_text
private

Definition at line 61 of file Message.h.

Referenced by operator=().


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