0029640: OCAF - add information on replacement of CDM_MessageDriver in upgrade guide.
authorabv <abv@opencascade.com>
Thu, 24 May 2018 15:43:22 +0000 (18:43 +0300)
committerabv <abv@opencascade.com>
Fri, 25 May 2018 18:54:55 +0000 (21:54 +0300)
Information on replacement of CDM_MessageDriver by Message_Messenger is added in the upgrade guide.
This replacement is recorded as rename in upgrade.dat

adm/upgrade.dat
dox/dev_guides/upgrade/upgrade.md

index 1abd84f..a56dd39 100644 (file)
@@ -70,6 +70,7 @@ BOPTools::MapShapes TopExp::MapShapes
 BOPTools::MapShapesAndAncestors TopExp::MapShapesAndAncestors
 BOPCol_Box2DBndTreeSelector BOPTools_BoxSelector<Bnd_Box2d>
 BiTgte_DataMapOfShapeBox TopTools_DataMapOfShapeBox
+CDM_MessageDriver Message_Messenger
 
 [tcollection]
 AdvApp2Var_SequenceOfNode
index 7be56a1..e1ad90f 100644 (file)
@@ -1564,3 +1564,15 @@ The API classes in the package BRepAlgo providing access to old Boolean operatio
 * BRepAlgo_Cut
 * BRepAlgo_Section
 Corresponding classes from the package BRepAlgoAPI should be used instead.
+
+@subsection upgrade_730_replace_CDM_MessageDriver_interface_by_Message_Messenger Unification of the Error/Warning reporting system of Application Framework
+
+Class *CDM_MessageDriver* and its descendants have been removed; class *Message_Messenger* is used instead in all OCAF packages.
+By default, messenger returned by *Message::DefaultMessenger()* is used, thus all messages generated by OCAF are directed in the common message queue of OCCT.
+
+In classes implementing OCAF persistence for custom attributes (those inheriting from *BinMDF_ADriver*, *XmlMDF_ADriver*), uses of method *WriteMessage()* should be replaced by call to method *Send()* of the inherited field *myMessageDriver*. Note that this method takes additional argument indicating the gravity of the message (Trace, Info, Warning, Alarm, or Fail).
+
+Class *Message_PrinterOStream* can be used instead of *CDM_COutMessageDriver* to direct all messages to a stream.
+If custom driver class is used in the application, that class shall be reimplemented inheriting from *Message_Printer* instead of *CDM_MessageDriver*.
+Method *Send()* should be redefined instead of method *Write()* of *CDM_MessageDriver*.
+To use the custom printer in OCAF, it can be either added to default messenger or set into the custom *Message_Messenger* object created in the method *MessageDriver()* of a class inheriting *CDF_Application*.