File indexing completed on 2026-10-05 09:23:10
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 #include <TCollection_AsciiString.hxx>
0020
0021 #include <NCollection_IndexedDataMap.hxx>
0022
0023 class Message_AlertExtended;
0024
0025
0026
0027 class Message_AttributeMeter : public Message_Attribute
0028 {
0029 public:
0030
0031
0032 static double UndefinedMetricValue() { return -1.0; }
0033
0034 public:
0035
0036 Standard_EXPORT Message_AttributeMeter(
0037 const TCollection_AsciiString& theName = TCollection_AsciiString::EmptyString());
0038
0039
0040
0041
0042 Standard_EXPORT bool HasMetric(const Message_MetricType& theMetric) const;
0043
0044
0045
0046
0047 Standard_EXPORT bool IsMetricValid(const Message_MetricType& theMetric) const;
0048
0049
0050
0051
0052 Standard_EXPORT double StartValue(const Message_MetricType& theMetric) const;
0053
0054
0055
0056 Standard_EXPORT void SetStartValue(const Message_MetricType& theMetric, const double theValue);
0057
0058
0059
0060
0061 Standard_EXPORT double StopValue(const Message_MetricType& theMetric) const;
0062
0063
0064
0065 Standard_EXPORT void SetStopValue(const Message_MetricType& theMetric, const double theValue);
0066
0067 public:
0068
0069
0070 static void StartAlert(const occ::handle<Message_AlertExtended>& theAlert)
0071 {
0072 SetAlertMetrics(theAlert, true);
0073 }
0074
0075
0076
0077 static void StopAlert(const occ::handle<Message_AlertExtended>& theAlert)
0078 {
0079 SetAlertMetrics(theAlert, false);
0080 }
0081
0082
0083
0084
0085
0086 static Standard_EXPORT void SetAlertMetrics(const occ::handle<Message_AlertExtended>& theAlert,
0087 const bool theStartValue);
0088
0089
0090 Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const override;
0091
0092 DEFINE_STANDARD_RTTIEXT(Message_AttributeMeter, Message_Attribute)
0093
0094 private:
0095 typedef std::pair<double, double> StartToStopValue;
0096
0097 NCollection_IndexedDataMap<Message_MetricType, StartToStopValue> myMetrics;
0098
0099 };
0100
0101 #endif