File indexing completed on 2025-01-18 10:04:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Message_HeaderFile
0018 #define _Message_HeaderFile
0019
0020 #include <Message_Messenger.hxx>
0021 #include <Message_Gravity.hxx>
0022 #include <Message_MetricType.hxx>
0023 #include <NCollection_Vector.hxx>
0024 #include <OSD_MemInfo.hxx>
0025
0026 #include <TCollection_AsciiString.hxx>
0027
0028 class Message_Report;
0029
0030
0031
0032
0033 class Message
0034 {
0035 public:
0036
0037 DEFINE_STANDARD_ALLOC
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 Standard_EXPORT static const Handle(Message_Messenger)& DefaultMessenger();
0052
0053 public:
0054
0055
0056 static Message_Messenger::StreamBuffer Send(Message_Gravity theGravity)
0057 {
0058 return DefaultMessenger()->Send (theGravity);
0059 }
0060
0061 static void Send(const TCollection_AsciiString& theMessage, Message_Gravity theGravity)
0062 {
0063 DefaultMessenger()->Send (theMessage, theGravity);
0064 }
0065
0066 static Message_Messenger::StreamBuffer SendFail() { return DefaultMessenger()->SendFail (); }
0067 static Message_Messenger::StreamBuffer SendAlarm() { return DefaultMessenger()->SendAlarm (); }
0068 static Message_Messenger::StreamBuffer SendWarning() { return DefaultMessenger()->SendWarning (); }
0069 static Message_Messenger::StreamBuffer SendInfo() { return DefaultMessenger()->SendInfo (); }
0070 static Message_Messenger::StreamBuffer SendTrace() { return DefaultMessenger()->SendTrace (); }
0071
0072 static void SendFail (const TCollection_AsciiString& theMessage) { return DefaultMessenger()->SendFail (theMessage); }
0073 static void SendAlarm (const TCollection_AsciiString& theMessage) { return DefaultMessenger()->SendAlarm (theMessage); }
0074 static void SendWarning (const TCollection_AsciiString& theMessage) { return DefaultMessenger()->SendWarning (theMessage); }
0075 static void SendInfo (const TCollection_AsciiString& theMessage) { return DefaultMessenger()->SendInfo (theMessage); }
0076 static void SendTrace (const TCollection_AsciiString& theMessage) { return DefaultMessenger()->SendTrace (theMessage); }
0077
0078 public:
0079
0080
0081
0082
0083
0084
0085 Standard_EXPORT static TCollection_AsciiString FillTime (const Standard_Integer Hour, const Standard_Integer Minute, const Standard_Real Second);
0086
0087 public:
0088
0089
0090 Standard_EXPORT static const Handle(Message_Report)& DefaultReport (const Standard_Boolean theToCreate = Standard_False);
0091
0092
0093
0094
0095
0096 Standard_EXPORT static Standard_Boolean MetricFromString (const Standard_CString theString,
0097 Message_MetricType& theType);
0098
0099
0100
0101
0102 Standard_EXPORT static Standard_CString MetricToString (const Message_MetricType theType);
0103
0104
0105
0106
0107 static Message_MetricType MetricFromString (const Standard_CString theString)
0108 {
0109 Message_MetricType aMetric = Message_MetricType_None;
0110 MetricFromString (theString, aMetric);
0111 return aMetric;
0112 }
0113
0114
0115
0116
0117
0118 static Standard_EXPORT Standard_Boolean ToOSDMetric (const Message_MetricType theMetric, OSD_MemInfo::Counter& theMemInfo);
0119
0120
0121
0122
0123
0124 static Standard_EXPORT Standard_Boolean ToMessageMetric (const OSD_MemInfo::Counter theMemInfo, Message_MetricType& theMetric);
0125
0126 };
0127
0128 #endif