// commercial license or contractual agreement.
#include <Message_Alert.hxx>
+#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Message_Alert,Standard_Transient)
// by default, merge trivially
return Standard_True;
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_Alert::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+}
//! Base implementation always returns true.
virtual Standard_EXPORT Standard_Boolean Merge (const Handle(Message_Alert)& theTarget);
+ //! Dumps the content of me into the stream
+ virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
DEFINE_STANDARD_RTTIEXT(Message_Alert,Standard_Transient)
};
#include <Precision.hxx>
#include <Standard_Assert.hxx>
+#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Message_AlertExtended,Message_Alert)
return anAlert;
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_AlertExtended::DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ if (!myCompositAlerts.IsNull())
+ {
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCompositAlerts.get())
+ }
+ if (!myAttribute.IsNull())
+ {
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myAttribute.get())
+ }
+}
const Handle(Message_Attribute)& theAttribute,
const Message_Gravity theGravity);
+ //! Dumps the content of me into the stream
+ virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
DEFINE_STANDARD_RTTIEXT(Message_AlertExtended, Message_Alert)
protected:
#include <Message_Attribute.hxx>
#include <Standard_Assert.hxx>
+#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Message_Attribute, Standard_Transient)
{
return !myName.IsEmpty() ? myName.ToCString() : "";
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_Attribute::DumpJson (Standard_OStream& theOStream, Standard_Integer) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_FIELD_VALUE_STRING (theOStream, myName)
+}
//! @param theName a name for the alert
void SetName (const TCollection_AsciiString& theName) { myName = theName; }
+ //! Dumps the content of me into the stream
+ virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
DEFINE_STANDARD_RTTIEXT(Message_Attribute, Standard_Transient)
private:
#include <OSD_Chronometer.hxx>
#include <Precision.hxx>
+#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Message_AttributeMeter, Message_Attribute)
aMeterAttribute->SetStopValue (aMetricType, (Standard_Real)aMemInfo.ValuePreciseMiB (anIterator.Value()));
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_AttributeMeter::DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Attribute)
+
+ for (NCollection_DataMap<Message_MetricType, StartToStopValue>::Iterator anIterator (myMetrics);
+ anIterator.More(); anIterator.Next())
+ {
+ Message_MetricType aMetricType = anIterator.Key();
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aMetricType)
+
+ Standard_Real aStartValue = anIterator.Value().first;
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aStartValue)
+
+ Standard_Real aStopValue = anIterator.Value().second;
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aStopValue)
+ }
+}
static Standard_EXPORT void SetAlertMetrics (const Handle(Message_AlertExtended)& theAlert,
const Standard_Boolean theStartValue);
+ //! Dumps the content of me into the stream
+ virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
DEFINE_STANDARD_RTTIEXT(Message_AttributeMeter, Message_Attribute)
private:
#define _Message_AttributeObject_HeaderFile
#include <Message_Attribute.hxx>
+#include <Standard_Dump.hxx>
class Standard_Transient;
//! @param theObject an instance
void SetObject (const Handle(Standard_Transient)& theObject) { myObject = theObject; }
+ //! Dumps the content of me into the stream
+ virtual void DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth = -1) const Standard_OVERRIDE
+ {
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Attribute)
+ OCCT_DUMP_FIELD_VALUE_POINTER (theOStream, myObject.get())
+ }
+
DEFINE_STANDARD_RTTI_INLINE(Message_AttributeObject, Message_Attribute)
private:
// commercial license or contractual agreement.
#include <Message_AttributeStream.hxx>
+#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Message_AttributeStream, Message_Attribute)
myStream << aStreamStr;
}
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_AttributeStream::DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Attribute)
+
+ TCollection_AsciiString aStream = Standard_Dump::Text (myStream);
+ OCCT_DUMP_FIELD_VALUE_STRING (theOStream, aStream)
+}
//! Sets stream value
Standard_EXPORT void SetStream (const Standard_SStream& theStream);
+ //! Dumps the content of me into the stream
+ virtual Standard_EXPORT void DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
DEFINE_STANDARD_RTTIEXT(Message_AttributeStream, Message_Attribute)
private:
#include <Message_CompositeAlerts.hxx>
#include <Message_AlertExtended.hxx>
#include <Standard_Assert.hxx>
+#include <Standard_Dump.hxx>
IMPLEMENT_STANDARD_RTTIEXT(Message_CompositeAlerts, Standard_Transient)
}
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_CompositeAlerts::DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ for (unsigned int i = 0; i < sizeof(myAlerts)/sizeof(myAlerts[0]); ++i)
+ {
+ Message_Gravity aGravity = (Message_Gravity)i;
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, aGravity)
+
+ for (Message_ListOfAlert::Iterator anIt (myAlerts[i]); anIt.More(); anIt.Next())
+ {
+ const Handle(Message_Alert)& anAlert = anIt.Value();
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, anAlert.get())
+ }
+ }
+}
//! @param theType an alert type
Standard_EXPORT void Clear (const Handle(Standard_Type)& theType);
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
DEFINE_STANDARD_RTTIEXT(Message_CompositeAlerts,Standard_Transient)
protected:
//purpose :
//=======================================================================
-Standard_Boolean Message_Report::IsActiveInMessenger (const Handle(Message_Messenger)& theMessenger) const
+Standard_Boolean Message_Report::IsActiveInMessenger (const Handle(Message_Messenger)&) const
{
return myIsActiveInMessenger;
}
Handle(Message_PrinterToReport)::DownCast (anIterator.Value())->Report() == this)
{
myIsActiveInMessenger = Standard_True;
+ return;
}
}
myIsActiveInMessenger = Standard_False;
myReportWriter->ExportReport (this);
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void Message_Report::DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+
+ if (!myCompositAlerts.IsNull())
+ {
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, myCompositAlerts.get())
+ }
+
+ Standard_Integer anAlertLevels = myAlertLevels.Size();
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, anAlertLevels)
+
+ for (NCollection_Map<Message_MetricType>::Iterator anIterator (myActiveMetrics); anIterator.More(); anIterator.Next())
+ {
+ Message_MetricType anActiveMetric = anIterator.Value();
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, anActiveMetric)
+ }
+
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myLimit)
+ OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, myIsActiveInMessenger)
+}
//! Merges alerts with specified gravity from theOther report into this
Standard_EXPORT void Merge (const Handle(Message_Report)& theOther, Message_Gravity theGravity);
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
+
DEFINE_STANDARD_RTTIEXT(Message_Report,Standard_Transient)
protected:
// Message_Info);
}
}
+
+//=======================================================================
+//function : DumpJson
+//purpose :
+//=======================================================================
+void TopoDS_AlertAttribute::DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth) const
+{
+ OCCT_DUMP_TRANSIENT_CLASS_BEGIN (theOStream)
+ OCCT_DUMP_BASE_CLASS (theOStream, theDepth, Message_Attribute)
+
+ OCCT_DUMP_FIELD_VALUES_DUMPED (theOStream, theDepth, &myShape)
+}
Standard_EXPORT static void Send (const Handle(Message_Messenger)& theMessenger,
const TopoDS_Shape& theShape);
+ //! Dumps the content of me into the stream
+ Standard_EXPORT void DumpJson (Standard_OStream& theOStream,
+ Standard_Integer theDepth = -1) const Standard_OVERRIDE;
+
// OCCT RTTI
DEFINE_STANDARD_RTTIEXT(TopoDS_AlertAttribute, Message_AttributeStream)
Message::DefaultMessenger()->AddPrinter (MyPrinterToReport);
Message::DefaultMessenger()->SetTraceLevel (1);
+ Message::DefaultReport()->UpdateActiveInMessenger();
myTreeModel->UpdateTreeModel();
}