mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- preparation
Operators << for Handle(Message_Messenger) are removed; their use is replaced by use of Message_Messenger::StreamBuffer Message_Messenger has been replaced by Standard_OStream within Interface_InterfaceModel,IFSelect,IGES,STEP dump interfaces.
This commit is contained in:
@@ -15,9 +15,6 @@
|
||||
#include <Interface_Check.hxx>
|
||||
#include <Interface_InterfaceModel.hxx>
|
||||
#include <Interface_MSG.hxx>
|
||||
#include <Message_Messenger.hxx>
|
||||
#include <Standard_Transient.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
#include <Transfer_Binder.hxx>
|
||||
#include <Transfer_Finder.hxx>
|
||||
#include <Transfer_FinderProcess.hxx>
|
||||
@@ -58,20 +55,20 @@ Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer nb)
|
||||
}
|
||||
|
||||
|
||||
void Transfer_FinderProcess::PrintTrace
|
||||
(const Handle(Transfer_Finder)& start, const Handle(Message_Messenger)& S) const
|
||||
{ if (!start.IsNull()) S<<" Type:"<<start->ValueTypeName(); }
|
||||
void Transfer_FinderProcess::PrintTrace (const Handle(Transfer_Finder)& start, Standard_OStream& S) const
|
||||
{
|
||||
if (!start.IsNull()) S << " Type:" << start->ValueTypeName();
|
||||
}
|
||||
|
||||
void Transfer_FinderProcess::PrintStats
|
||||
(const Standard_Integer mode, const Handle(Message_Messenger)& S) const
|
||||
void Transfer_FinderProcess::PrintStats (const Standard_Integer mode, Standard_OStream& S) const
|
||||
{
|
||||
S<<"\n*******************************************************************\n";
|
||||
if (mode == 1) { // Statistiques de base
|
||||
S << "******** Basic Statistics ********"<<Message_EndLine;
|
||||
S<< "******** Basic Statistics ********"<<std::endl;
|
||||
|
||||
Standard_Integer nbr = 0, nbe = 0, nbw = 0;
|
||||
Standard_Integer i, max = NbMapped(), nbroots = NbRoots();
|
||||
S << "**** Nb Final Results : "<<nbroots<<Message_EndLine;
|
||||
S<< "**** Nb Final Results : "<< nbroots <<std::endl;
|
||||
|
||||
for (i = 1; i <= max; i ++) {
|
||||
const Handle(Transfer_Binder)& binder = MapItem(i);
|
||||
@@ -86,12 +83,12 @@ Transfer_FinderProcess::Transfer_FinderProcess (const Standard_Integer nb)
|
||||
}
|
||||
}
|
||||
if (nbr > nbroots)
|
||||
S<<"**** ( Itermediate Results : "<<nbr-nbroots<<" )\n";
|
||||
S<<"**** ( Itermediate Results : "<<nbr-nbroots <<" )\n";
|
||||
if (nbe > 0)
|
||||
S<<"**** Errors on :"<<Interface_MSG::Blanks(nbe,4)<<nbe<<" Entities\n";
|
||||
if (nbw > 0)
|
||||
S<<"**** Warnings on : "<<Interface_MSG::Blanks(nbw,4)<<nbw<<" Entities\n";
|
||||
S<<"*******************************************************************";
|
||||
}
|
||||
S<<Message_EndLine;
|
||||
S<<std::endl;
|
||||
}
|
||||
|
@@ -23,7 +23,6 @@
|
||||
class Interface_InterfaceModel;
|
||||
class Transfer_TransientMapper;
|
||||
class Transfer_Finder;
|
||||
class Message_Messenger;
|
||||
|
||||
class Transfer_FinderProcess;
|
||||
DEFINE_STANDARD_HANDLE(Transfer_FinderProcess, Transfer_ProcessForFinder)
|
||||
@@ -69,10 +68,10 @@ public:
|
||||
Standard_EXPORT Handle(Transfer_TransientMapper) TransientMapper (const Handle(Standard_Transient)& obj) const;
|
||||
|
||||
//! Specific printing to trace a Finder (by its method ValueType)
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, const Handle(Message_Messenger)& S) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, Standard_OStream& S) const Standard_OVERRIDE;
|
||||
|
||||
//! Prints statistics on a given output, according mode
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer mode, const Handle(Message_Messenger)& S) const;
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer mode, Standard_OStream& S) const;
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(Transfer_FinderProcess,Transfer_ProcessForFinder)
|
||||
|
||||
|
@@ -350,7 +350,7 @@ public:
|
||||
|
||||
//! Prints a short information on a starting object. By default
|
||||
//! prints its Dynamic Type. Can be redefined
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, const Handle(Message_Messenger)& S) const;
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, Standard_OStream& S) const;
|
||||
|
||||
//! Returns True if we are surely in a DeadLoop. Evaluation is not
|
||||
//! exact, it is a "majorant" which must be computed fast.
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#include <TColStd_HSequenceOfTransient.hxx>
|
||||
|
||||
class Message_Messenger;
|
||||
class Standard_Transient;
|
||||
class Transfer_Binder;
|
||||
class Transfer_ActorOfProcessForTransient;
|
||||
class Message_ProgressIndicator;
|
||||
@@ -338,7 +337,7 @@ public:
|
||||
|
||||
//! Prints a short information on a starting object. By default
|
||||
//! prints its Dynamic Type. Can be redefined
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const;
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, Standard_OStream& S) const;
|
||||
|
||||
//! Returns True if we are surely in a DeadLoop. Evaluation is not
|
||||
//! exact, it is a "majorant" which must be computed fast.
|
||||
|
@@ -456,10 +456,11 @@ void Transfer_TransferProcess::SendMsg(const TheStart& start,
|
||||
// Alimente la trace : Regle causant (user messages)
|
||||
if (thetrace > 0) {
|
||||
StartTrace (binder,start,thelevel,6);
|
||||
themessenger << amsg.Value();
|
||||
Message_Messenger::StreamBuffer aSender = themessenger->SendInfo();
|
||||
aSender << amsg.Value();
|
||||
if (amsg.IsEdited()&&thetrace>2)
|
||||
themessenger << " [from: " << amsg.Original() << "]";
|
||||
themessenger << Message_EndLine;
|
||||
aSender << " [from: " << amsg.Original() << "]";
|
||||
aSender << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -481,9 +482,10 @@ void Transfer_TransferProcess::AddFail(const TheStart& start,
|
||||
binder->AddFail (mess,orig);
|
||||
if (thetrace > 0) {
|
||||
StartTrace (binder,start,thelevel,1);
|
||||
themessenger << " --> Fail : " << mess;
|
||||
if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]";
|
||||
themessenger << Message_EndLine;
|
||||
Message_Messenger::StreamBuffer aSender = themessenger->SendFail();
|
||||
aSender << " --> Fail : " << mess;
|
||||
if (orig[0] != '\0'&&thetrace>2) aSender << " [from: " << orig << "]";
|
||||
aSender << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,9 +534,10 @@ void Transfer_TransferProcess::AddWarning(const TheStart& start,
|
||||
binder->AddWarning(mess,orig);
|
||||
if (thetrace > 1) {
|
||||
StartTrace (binder,start,thelevel,2);
|
||||
themessenger << " --> Warning : " << mess;
|
||||
if (orig[0] != '\0'&&thetrace>2) themessenger << " [from: " << orig << "]";
|
||||
themessenger << Message_EndLine;
|
||||
Message_Messenger::StreamBuffer aSender = themessenger->SendWarning();
|
||||
aSender << " --> Warning : " << mess;
|
||||
if (orig[0] != '\0'&&thetrace>2) aSender << " [from: " << orig << "]";
|
||||
aSender << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1007,6 +1010,7 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
|
||||
// .... Etat Initial : peut-etre deja fait ... ou infaisable !
|
||||
|
||||
Message_Messenger::StreamBuffer aSender = themessenger->SendInfo();
|
||||
//if (!former.IsNull()) {
|
||||
Transfer_StatusExec statex = former->StatusExec();
|
||||
switch (statex) {
|
||||
@@ -1014,7 +1018,7 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
break;
|
||||
case Transfer_StatusDone : // Transfert deja fait
|
||||
//#ifdef TRANSLOG
|
||||
themessenger << " .. and Transfer done" << Message_EndLine;
|
||||
aSender << " .. and Transfer done" << std::endl;
|
||||
//#endif
|
||||
// if (former->HasResult()) former->SetAlreadyUsed();
|
||||
return former;
|
||||
@@ -1023,7 +1027,7 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
return former;
|
||||
case Transfer_StatusError : // pas propre, ca ...
|
||||
if (thetrace) {
|
||||
themessenger << " *** Transfer in Error Status :" << Message_EndLine;
|
||||
aSender << " *** Transfer in Error Status :" << std::endl;
|
||||
StartTrace (former, start, thelevel,0);
|
||||
// (*themessenger->Out()) << flush;
|
||||
}
|
||||
@@ -1031,7 +1035,7 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
throw Transfer_TransferFailure("TransferProcess : Transfer in Error Status");
|
||||
case Transfer_StatusLoop : // la boucle est bouclee ...
|
||||
if (thetrace) {
|
||||
themessenger << " *** Transfer Head of Dead Loop :" << Message_EndLine;
|
||||
aSender << " *** Transfer Head of Dead Loop :" << std::endl;
|
||||
StartTrace (former, start, thelevel,0);
|
||||
// (*themessenger->Out()) << flush;
|
||||
}
|
||||
@@ -1054,6 +1058,8 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
Handle(Transfer_Binder) binder;
|
||||
Standard_Boolean newbind = Standard_False;
|
||||
if (theerrh) {
|
||||
Message_Messenger::StreamBuffer aSender = themessenger->SendInfo();
|
||||
|
||||
// Transfert sous protection pour les exceptions (pour notification en fait)
|
||||
Standard_Integer oldlev = thelevel;
|
||||
try {
|
||||
@@ -1064,13 +1070,13 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
// ... Exceptions a Rattraper : elles ne se ressemblent pas toutes ... !
|
||||
catch (Transfer_TransferDeadLoop const&) {
|
||||
if (binder.IsNull()) {
|
||||
themessenger << " *** Dead Loop with no Result" << Message_EndLine;
|
||||
aSender << " *** Dead Loop with no Result" << std::endl;
|
||||
if (thetrace) StartTrace (binder, start, thelevel-1,0);
|
||||
binder = new Transfer_VoidBinder;
|
||||
Bind (start,binder); newbind = Standard_True;
|
||||
} else if (binder->StatusExec() == Transfer_StatusLoop) {
|
||||
if (thetrace) {
|
||||
themessenger << " *** Dead Loop : Finding head of Loop :" << Message_EndLine;
|
||||
aSender << " *** Dead Loop : Finding head of Loop :" << std::endl;
|
||||
StartTrace (binder, start, thelevel-1,0);
|
||||
}
|
||||
else StartTrace (binder, start,thelevel-1,4);
|
||||
@@ -1078,7 +1084,7 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
// Autrement dit, on change d exception (on est sorti de la boucle)
|
||||
} else {
|
||||
if (thetrace) {
|
||||
themessenger << " *** Dead Loop : Actor in Loop :" << Message_EndLine;
|
||||
aSender << " *** Dead Loop : Actor in Loop :" << std::endl;
|
||||
StartTrace (binder, start, thelevel-1,0);
|
||||
}
|
||||
}
|
||||
@@ -1087,13 +1093,13 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
}
|
||||
catch (Standard_Failure const& anException) {
|
||||
if (binder.IsNull()) {
|
||||
themessenger << " *** Exception Raised with no Result" << Message_EndLine;
|
||||
aSender << " *** Exception Raised with no Result" << std::endl;
|
||||
binder = new Transfer_VoidBinder;
|
||||
Bind (start,binder); newbind = Standard_True;
|
||||
}
|
||||
binder->AddFail("Transfer stopped by exception raising");
|
||||
if (thetrace) {
|
||||
themessenger << " *** Raised : " << anException.GetMessageString() << Message_EndLine;
|
||||
aSender << " *** Raised : " << anException.GetMessageString() << std::endl;
|
||||
StartTrace (binder, start, thelevel-1,4);
|
||||
}
|
||||
thelevel = oldlev;
|
||||
@@ -1158,7 +1164,7 @@ Handle(Transfer_Binder) Transfer_TransferProcess::Transferring(const TheStart& s
|
||||
}
|
||||
if (binder.IsNull()) {
|
||||
// if (thetrace) {
|
||||
// themessenger << "Transfer has produced no Result" <<endl;
|
||||
// aSender << "Transfer has produced no Result" <<endl;
|
||||
// StartTrace (binder, start, thelevel-1,0); sout << flush;
|
||||
// }
|
||||
if (thelevel > 0) thelevel --;
|
||||
@@ -1222,21 +1228,22 @@ void Transfer_TransferProcess::StartTrace(const Handle(Transfer_Binder)& binder,
|
||||
const Standard_Integer level,
|
||||
const Standard_Integer mode) const
|
||||
{
|
||||
Message_Messenger::StreamBuffer aSender = themessenger->SendInfo();
|
||||
// ### Fail (Roots:50) -- Start start->DynamicType()
|
||||
// ### Fail (Roots:50) -- Start id:#label.. Type:start->DynamicType()
|
||||
if (thetrace > 3) { // Internal to be switch when searching bug (trace >= 4)
|
||||
if (mode == 1) themessenger << " ### Fail";
|
||||
if (mode == 2) themessenger << " ### Warning";
|
||||
if (mode == 3) themessenger << " ### New Root n0 " << theroots.Extent();
|
||||
if (mode == 4) themessenger << " ### Exception";
|
||||
if (mode == 5) themessenger << " ### Substitution";
|
||||
if (mode == 6) themessenger << " ### Information";
|
||||
if (mode == 1) aSender << " ### Fail";
|
||||
if (mode == 2) aSender << " ### Warning";
|
||||
if (mode == 3) aSender << " ### New Root n0 " << theroots.Extent();
|
||||
if (mode == 4) aSender << " ### Exception";
|
||||
if (mode == 5) aSender << " ### Substitution";
|
||||
if (mode == 6) aSender << " ### Information";
|
||||
if (level > 1)
|
||||
themessenger << " (nested)"; // " at nesting Level:"<<level;
|
||||
aSender << " (nested)"; // " at nesting Level:"<<level;
|
||||
if (mode >= 0 && mode != 3)
|
||||
themessenger << " at " << theroots.Extent() << " Roots";
|
||||
aSender << " at " << theroots.Extent() << " Roots";
|
||||
}
|
||||
if (!start.IsNull()) PrintTrace (start,themessenger);
|
||||
if (!start.IsNull()) PrintTrace (start,aSender);
|
||||
//// sout << endl;
|
||||
|
||||
if (!binder.IsNull()) { // old: if IsNull sout <<endl<< " --- Not Bound";
|
||||
@@ -1246,10 +1253,10 @@ void Transfer_TransferProcess::StartTrace(const Handle(Transfer_Binder)& binder,
|
||||
if (bnd->Status() != Transfer_StatusVoid) {
|
||||
// --- Result Type: binder->ResultType() --- Binder : binder->DynamicType();
|
||||
if (!hasres)
|
||||
themessenger << "\n --- Result Type : ";
|
||||
aSender << "\n --- Result Type : ";
|
||||
else
|
||||
themessenger << " , ";
|
||||
themessenger << bnd->ResultTypeName();
|
||||
aSender << " , ";
|
||||
aSender << bnd->ResultTypeName();
|
||||
// CKY 9-JAN-1999: waiting for XSTEP Kernel message (not IGES_2075)
|
||||
/* Message_Msg Msg2075("IGES_2075");
|
||||
Msg2075.AddString(bnd->ResultTypeName());
|
||||
@@ -1259,7 +1266,7 @@ void Transfer_TransferProcess::StartTrace(const Handle(Transfer_Binder)& binder,
|
||||
bnd = bnd->NextResult();
|
||||
}
|
||||
if (!hasres && mode > 2) {
|
||||
themessenger << "\n --- No Result recorded";
|
||||
aSender << "\n --- No Result recorded";
|
||||
// CKY 9-JAN-1999 : waiting for XSTEP Kernel message
|
||||
// (not IGES_2075, no reference to specifically TopoDS_Shape)
|
||||
/* Message_Msg Msg2075("IGES_2075");
|
||||
@@ -1268,7 +1275,7 @@ void Transfer_TransferProcess::StartTrace(const Handle(Transfer_Binder)& binder,
|
||||
}
|
||||
//old if (isused) sout << " -- (Already Used in another Transfer)";
|
||||
}
|
||||
themessenger << Message_EndLine;
|
||||
aSender << std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -1277,8 +1284,7 @@ void Transfer_TransferProcess::StartTrace(const Handle(Transfer_Binder)& binder,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Transfer_TransferProcess::PrintTrace(const TheStart& start,
|
||||
const Handle(Message_Messenger)& S) const
|
||||
void Transfer_TransferProcess::PrintTrace(const TheStart& start, Standard_OStream& S) const
|
||||
{
|
||||
if (!start.IsNull()) S <<" Type:" << start->DynamicType()->Name();
|
||||
}
|
||||
|
@@ -153,16 +153,16 @@ NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& Transf
|
||||
//=======================================================================
|
||||
|
||||
void Transfer_TransientProcess::PrintTrace
|
||||
(const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const
|
||||
(const Handle(Standard_Transient)& start, Standard_OStream& S) const
|
||||
{
|
||||
if (!start.IsNull()) {
|
||||
S << "Entity ";
|
||||
if (!themodel.IsNull()) {
|
||||
themodel->Print (start,S,1);
|
||||
S << "Entity ";
|
||||
themodel->Print (start, S, 1);
|
||||
// S<<"id "; themodel->Print (start,S);
|
||||
// S<<" Type:"<<themodel->TypeName (start);
|
||||
}
|
||||
else S<<" Type:"<< Interface_InterfaceModel::ClassName(start->DynamicType()->Name());
|
||||
else S<<"Entity Type:"<< Interface_InterfaceModel::ClassName(start->DynamicType()->Name());
|
||||
// << start (handle) ??
|
||||
}
|
||||
}
|
||||
@@ -234,20 +234,20 @@ Standard_Boolean Transfer_TransientProcess::IsDataFail
|
||||
//=======================================================================
|
||||
|
||||
void Transfer_TransientProcess::PrintStats(const Standard_Integer /*mode*/,
|
||||
const Handle(Message_Messenger)& S) const
|
||||
Standard_OStream& S) const
|
||||
{
|
||||
S<<"\n*******************************************************************\n";
|
||||
// if (mode == 1) { // Statistiques de base
|
||||
S << "******** Basic Statistics ********"<<Message_EndLine;
|
||||
S<< "******** Basic Statistics ********"<<std::endl;
|
||||
|
||||
Handle(Interface_InterfaceModel) model = Model();
|
||||
if (model.IsNull()) S<<"**** Model unknown"<<Message_EndLine;
|
||||
if (model.IsNull()) S<<"**** Model unknown"<<std::endl;
|
||||
else
|
||||
S<<"**** Nb Entities : "<<model->NbEntities()<<Message_EndLine;
|
||||
S<<"**** Nb Entities : "<<model->NbEntities()<<std::endl;
|
||||
|
||||
Standard_Integer nbr = 0, nbe = 0, nbw = 0;
|
||||
Standard_Integer i, max = NbMapped(), nbroots = NbRoots();
|
||||
S << "**** Nb Final Results : "<<nbroots<<Message_EndLine;
|
||||
S<< "**** Nb Final Results : "<<nbroots<<std::endl;
|
||||
|
||||
for (i = 1; i <= max; i ++) {
|
||||
const Handle(Transfer_Binder)& binder = MapItem(i);
|
||||
@@ -269,7 +269,7 @@ void Transfer_TransientProcess::PrintStats(const Standard_Integer /*mode*/,
|
||||
S<<"**** Warnings on : "<<Interface_MSG::Blanks(nbw,4)<<nbw<<" Entities\n";
|
||||
S<<"*******************************************************************";
|
||||
// }
|
||||
S<<Message_EndLine;
|
||||
S<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -32,10 +32,8 @@
|
||||
class Interface_InterfaceModel;
|
||||
class Interface_HGraph;
|
||||
class Interface_Graph;
|
||||
class Message_Messenger;
|
||||
class Interface_EntityIterator;
|
||||
|
||||
|
||||
class Transfer_TransientProcess;
|
||||
DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_ProcessForTransient)
|
||||
|
||||
@@ -85,7 +83,7 @@ public:
|
||||
|
||||
//! Specific printing to trace an entity : prints label and type
|
||||
//! (if model is set)
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, Standard_OStream& S) const Standard_OVERRIDE;
|
||||
|
||||
//! Specific number of a starting object for check-list : Number
|
||||
//! in model
|
||||
@@ -110,7 +108,7 @@ public:
|
||||
Standard_EXPORT Standard_Boolean IsDataFail (const Handle(Standard_Transient)& ent) const;
|
||||
|
||||
//! Prints statistics on a given output, according mode
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer mode, const Handle(Message_Messenger)& S) const;
|
||||
Standard_EXPORT void PrintStats (const Standard_Integer mode, Standard_OStream& S) const;
|
||||
|
||||
Standard_EXPORT Handle(TColStd_HSequenceOfTransient) RootsForTransfer();
|
||||
|
||||
|
Reference in New Issue
Block a user