Open CASCADE Technology  7.6.0
Public Member Functions

Message_Level Class Reference

This class is an instance of Sentry to create a level in a message report Constructor of the class add new (active) level in the report, destructor removes it While the level is active in the report, new alerts are added below the level root alert. More...

#include <Message_Level.hxx>

Public Member Functions

 Message_Level (const TCollection_AsciiString &theName=TCollection_AsciiString())
 Constructor. One string key is used for all alert meters. The perf meter is not started automatically, it will be done in AddAlert() method. More...
 
 ~Message_Level ()
 Assures stopping upon destruction. More...
 
const Handle< Message_AlertExtended > & RootAlert () const
 Returns root alert of the level. More...
 
void SetRootAlert (const Handle< Message_AlertExtended > &theAlert, const Standard_Boolean isRequiredToStart)
 Sets the root alert. Starts collects alert metrics if active. More...
 
Standard_Boolean AddAlert (const Message_Gravity theGravity, const Handle< Message_Alert > &theAlert)
 Adds new alert on the level. Stops the last alert metric, appends the alert and starts the alert metrics collecting. Sets root alert beforehand this method using, if the root is NULL, it does nothing. More...
 

Detailed Description

This class is an instance of Sentry to create a level in a message report Constructor of the class add new (active) level in the report, destructor removes it While the level is active in the report, new alerts are added below the level root alert.

The first added alert is a root alert, other are added below the root alert

If alert has Message_AttributeMeter attribute, active metrics of the default report are stored in the attribute: start value of metric on adding alert, stop on adding another alert or closing (delete) the level in the report.

Processing of this class is implemented in Message_Report, it is used only inside it. Levels using should be only through using OCCT_ADD_MESSAGE_LEVEL_SENTRY only. No other code is required outside.

Constructor & Destructor Documentation

◆ Message_Level()

Message_Level::Message_Level ( const TCollection_AsciiString theName = TCollection_AsciiString())

Constructor. One string key is used for all alert meters. The perf meter is not started automatically, it will be done in AddAlert() method.

◆ ~Message_Level()

Message_Level::~Message_Level ( )

Assures stopping upon destruction.

Member Function Documentation

◆ AddAlert()

Standard_Boolean Message_Level::AddAlert ( const Message_Gravity  theGravity,
const Handle< Message_Alert > &  theAlert 
)

Adds new alert on the level. Stops the last alert metric, appends the alert and starts the alert metrics collecting. Sets root alert beforehand this method using, if the root is NULL, it does nothing.

Parameters
theGravityan alert gravity
theAlertan alert
Returns
true if alert is added

◆ RootAlert()

const Handle< Message_AlertExtended >& Message_Level::RootAlert ( ) const
inline

Returns root alert of the level.

Returns
alert instance or NULL

◆ SetRootAlert()

void Message_Level::SetRootAlert ( const Handle< Message_AlertExtended > &  theAlert,
const Standard_Boolean  isRequiredToStart 
)

Sets the root alert. Starts collects alert metrics if active.

Parameters
theAlertan alert

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