File indexing completed on 2025-01-18 10:04:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef _Message_AttributeMeter_HeaderFile
0015 #define _Message_AttributeMeter_HeaderFile
0016
0017 #include <Message_Attribute.hxx>
0018 #include <Message_MetricType.hxx>
0019
0020 #include <NCollection_IndexedDataMap.hxx>
0021
0022 class Message_AlertExtended;
0023
0024
0025
0026 class Message_AttributeMeter : public Message_Attribute
0027 {
0028 public:
0029
0030
0031
0032 static Standard_Real UndefinedMetricValue() { return -1.0; }
0033
0034 public:
0035
0036
0037 Standard_EXPORT Message_AttributeMeter (const TCollection_AsciiString& theName = TCollection_AsciiString());
0038
0039
0040
0041
0042 Standard_EXPORT Standard_Boolean HasMetric (const Message_MetricType& theMetric) const;
0043
0044
0045
0046
0047 Standard_EXPORT Standard_Boolean IsMetricValid (const Message_MetricType& theMetric) const;
0048
0049
0050
0051
0052 Standard_EXPORT Standard_Real StartValue (const Message_MetricType& theMetric) const;
0053
0054
0055
0056 Standard_EXPORT void SetStartValue (const Message_MetricType& theMetric, const Standard_Real theValue);
0057
0058
0059
0060
0061 Standard_EXPORT Standard_Real StopValue (const Message_MetricType& theMetric) const;
0062
0063
0064
0065 Standard_EXPORT void SetStopValue (const Message_MetricType& theMetric, const Standard_Real theValue);
0066
0067 public:
0068
0069
0070
0071 static void StartAlert (const Handle(Message_AlertExtended)& theAlert) { SetAlertMetrics (theAlert, Standard_True); }
0072
0073
0074
0075 static void StopAlert (const Handle(Message_AlertExtended)& theAlert) { SetAlertMetrics (theAlert, Standard_False); }
0076
0077
0078
0079
0080
0081 static Standard_EXPORT void SetAlertMetrics (const Handle(Message_AlertExtended)& theAlert,
0082 const Standard_Boolean theStartValue);
0083
0084
0085 virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream,
0086 Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0087
0088 DEFINE_STANDARD_RTTIEXT(Message_AttributeMeter, Message_Attribute)
0089
0090 private:
0091
0092 typedef std::pair<Standard_Real, Standard_Real> StartToStopValue;
0093 NCollection_IndexedDataMap<Message_MetricType, StartToStopValue> myMetrics;
0094 };
0095
0096 #endif