Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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::EmptyString())
 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 ()
 Assures stopping upon destruction.
 
const occ::handle< Message_AlertExtended > & RootAlert () const
 Returns root alert of the level.
 
void SetRootAlert (const occ::handle< Message_AlertExtended > &theAlert, const bool isRequiredToStart)
 Sets the root alert. Starts collects alert metrics if active.
 
bool AddAlert (const Message_Gravity theGravity, const occ::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.
 

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::EmptyString())

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()

bool Message_Level::AddAlert ( const Message_Gravity theGravity,
const occ::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 occ::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 occ::handle< Message_AlertExtended > & theAlert,
const bool 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: