HOPS
HOPS class reference
Public Member Functions | Static Public Member Functions | List of all members
hops::MHO_Message Class Reference

uses the singleton pattern (as we only have one terminal) More...

#include <MHO_Message.hh>

Public Member Functions

 MHO_Message (MHO_Message &&)=delete
 Deleted move constructor (singleton). More...
 
 MHO_Message (MHO_Message const &)=delete
 Deleted copy constructor (singleton). More...
 
void AcceptAllKeys ()
 Allow all message keys (no category/library filtering). More...
 
void AddKey (const char *key)
 
void AddKey (const std::string &key)
 Add a message key to the allowed key set. More...
 
void Flush ()
 Flush the current output stream buffer. More...
 
MHO_MessageLevel GetMessageLevel () const
 Get the currently configured message level threshold. More...
 
void LimitToKeySet ()
 Restrict messages to a defined key set. More...
 
void Lock ()
 Lock the message handler for thread-safe operations. More...
 
MHO_Messageoperator<< (const MHO_MessageEndline &)
 
MHO_Messageoperator<< (const MHO_MessageNewline &)
 
template<class XStreamableItemType >
MHO_Messageoperator<< (const XStreamableItemType &item)
 Stream an item into the current message. More...
 
MHO_Messageoperator= (MHO_Message &&)=delete
 Deleted move assignment operator (singleton). More...
 
MHO_Messageoperator= (MHO_Message const &)=delete
 Deleted copy assignment operator (singleton). More...
 
void RemoveAllKeys ()
 Remove all message keys (disables all filtering). More...
 
void RemoveKey (const char *key)
 
void RemoveKey (const std::string &key)
 Remove a message key from the allowed key set. More...
 
MHO_MessageSendMessage (const MHO_MessageLevel &level, const char *key)
 
MHO_MessageSendMessage (const MHO_MessageLevel &level, const std::string &key)
 Begin a new message with a specific level and key. More...
 
void SetLegacyMessageLevel (int legacy_message_level)
 Set the message level using a legacy integer interface. More...
 
void SetMessageLevel (MHO_MessageLevel level)
 Set the allowed message level threshold. More...
 
void Unlock ()
 Unlock the message handler. More...
 

Static Public Member Functions

static MHO_MessageGetInstance ()
 Access the singleton instance of the message handler. More...
 

Detailed Description

uses the singleton pattern (as we only have one terminal)

class for managing messages to stdout

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Wed Oct 14 17:17:31 2020 -0400

Constructor & Destructor Documentation

◆ MHO_Message() [1/2]

hops::MHO_Message::MHO_Message ( MHO_Message const &  )
delete

Deleted copy constructor (singleton).

◆ MHO_Message() [2/2]

hops::MHO_Message::MHO_Message ( MHO_Message &&  )
delete

Deleted move constructor (singleton).

Member Function Documentation

◆ AcceptAllKeys()

void hops::MHO_Message::AcceptAllKeys ( )
inline

Allow all message keys (no category/library filtering).

◆ AddKey() [1/2]

void hops::MHO_Message::AddKey ( const char *  key)

◆ AddKey() [2/2]

void hops::MHO_Message::AddKey ( const std::string &  key)

Add a message key to the allowed key set.

Parameters
keyThe key string to add.

◆ Flush()

void hops::MHO_Message::Flush ( )

Flush the current output stream buffer.

◆ GetInstance()

static MHO_Message& hops::MHO_Message::GetInstance ( )
inlinestatic

Access the singleton instance of the message handler.

Returns
Reference to the singleton MHO_Message instance.

◆ GetMessageLevel()

MHO_MessageLevel hops::MHO_Message::GetMessageLevel ( ) const
inline

Get the currently configured message level threshold.

Returns
The currently allowed message level.

◆ LimitToKeySet()

void hops::MHO_Message::LimitToKeySet ( )
inline

Restrict messages to a defined key set.

◆ Lock()

void hops::MHO_Message::Lock ( )
inline

Lock the message handler for thread-safe operations.

◆ operator<<() [1/3]

MHO_Message & hops::MHO_Message::operator<< ( const MHO_MessageEndline )

◆ operator<<() [2/3]

MHO_Message & hops::MHO_Message::operator<< ( const MHO_MessageNewline )

◆ operator<<() [3/3]

template<class XStreamableItemType >
MHO_Message & hops::MHO_Message::operator<< ( const XStreamableItemType &  item)

Stream an item into the current message.

Template Parameters
XStreamableItemTypeAny type that supports output streaming via operator<<.
Parameters
itemThe item to insert into the message stream.
Returns
Reference to the MHO_Message instance for chaining.

◆ operator=() [1/2]

MHO_Message& hops::MHO_Message::operator= ( MHO_Message &&  )
delete

Deleted move assignment operator (singleton).

◆ operator=() [2/2]

MHO_Message& hops::MHO_Message::operator= ( MHO_Message const &  )
delete

Deleted copy assignment operator (singleton).

◆ RemoveAllKeys()

void hops::MHO_Message::RemoveAllKeys ( )

Remove all message keys (disables all filtering).

◆ RemoveKey() [1/2]

void hops::MHO_Message::RemoveKey ( const char *  key)

◆ RemoveKey() [2/2]

void hops::MHO_Message::RemoveKey ( const std::string &  key)

Remove a message key from the allowed key set.

Parameters
keyThe key string to remove.

◆ SendMessage() [1/2]

MHO_Message & hops::MHO_Message::SendMessage ( const MHO_MessageLevel level,
const char *  key 
)

◆ SendMessage() [2/2]

MHO_Message & hops::MHO_Message::SendMessage ( const MHO_MessageLevel level,
const std::string &  key 
)

Begin a new message with a specific level and key.

Parameters
levelThe message level.
keyThe message key to associate with this message.
Returns
Reference to the MHO_Message instance for streaming content.

◆ SetLegacyMessageLevel()

void hops::MHO_Message::SetLegacyMessageLevel ( int  legacy_message_level)

Set the message level using a legacy integer interface.

Parameters
legacy_message_levellegacy integer representation of message level (lower is more verbose, min: -2, max: 5).

◆ SetMessageLevel()

void hops::MHO_Message::SetMessageLevel ( MHO_MessageLevel  level)
inline

Set the allowed message level threshold.

Parameters
levelThe new minimum message level to accept.

◆ Unlock()

void hops::MHO_Message::Unlock ( )
inline

Unlock the message handler.


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