Hopsan
HopsanCoreMessageHandler Class Reference

Public Member Functions

void addInfoMessage (const HString &rMessage, const HString &rTag="", const int dbglevel=0)
 Convenience function to add info message.
 
void addWarningMessage (const HString &rMessage, const HString &rTag="", const int dbglevel=0)
 Convenience function to add warning message.
 
void addErrorMessage (const HString &rMessage, const HString &rTag="", const int dbglevel=0)
 Convenience function to add error message.
 
void addDebugMessage (const HString &rMessage, const HString &rTag="", const int dbglevel=0)
 Convenience function to add debug message.
 
void addFatalMessage (const HString &rMessage, const HString &rTag="", const int dbglevel=0)
 Convenience function to add fatal message. Also tells the receiver of the message to close program in a controlled way.
 
void getMessage (HString &rMessage, HString &rType, HString &rTag)
 Returns the next, (pops) message on the message queue.
 
size_t getNumWaitingMessages () const
 Returns the number of waiting messages on the message queue.
 
size_t getNumInfoMessages () const
 Returns the number of waiting info messages on the message queue.
 
size_t getNumWarningMessages () const
 Returns the number of waiting warning messages on the message queue.
 
size_t getNumErrorMessages () const
 Returns the number of waiting error messages on the message queue.
 
size_t getNumDebugMessages () const
 Returns the number of waiting debug messages on the message queue.
 
size_t getNumFatalMessages () const
 Returns the number of waiting fatal messages on the message queue.
 
void printMessagesToStdOut ()
 

Member Function Documentation

◆ addDebugMessage()

void addDebugMessage ( const HString & rMessage,
const HString & rTag = "",
const int dbglevel = 0 )

Convenience function to add debug message.

Parameters
[in]rMessageThe message string
[in]rTagA tag describing the message
[in]dbglevelThe debuglevel for the message

◆ addErrorMessage()

void addErrorMessage ( const HString & rMessage,
const HString & rTag = "",
const int dbglevel = 0 )

Convenience function to add error message.

Parameters
[in]rMessageThe message string
[in]rTagA tag describing the message
[in]dbglevelThe debuglevel for the message

◆ addFatalMessage()

void addFatalMessage ( const HString & rMessage,
const HString & rTag = "",
const int dbglevel = 0 )

Convenience function to add fatal message. Also tells the receiver of the message to close program in a controlled way.

Parameters
[in]rMessageThe message string
[in]rTagA tag describing the message
[in]dbglevelThe debuglevel for the message

◆ addInfoMessage()

void addInfoMessage ( const HString & rMessage,
const HString & rTag = "",
const int dbglevel = 0 )

Convenience function to add info message.

Parameters
[in]rMessageThe message string
[in]rTagA tag describing the message
[in]dbglevelThe debuglevel for the message

◆ addWarningMessage()

void addWarningMessage ( const HString & rMessage,
const HString & rTag = "",
const int dbglevel = 0 )

Convenience function to add warning message.

Parameters
[in]rMessageThe message string
[in]rTagA tag describing the message
[in]dbglevelThe debuglevel for the message

◆ getMessage()

void getMessage ( HString & rMessage,
HString & rType,
HString & rTag )

Returns the next, (pops) message on the message queue.

Parameters
[out]rMessageThe message string
[out]rTypeThe message type(Info, Error, Warning...)
[out]rTagA tag describing the message