1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0026937: Eliminate NO_CXX_EXCEPTION macro support

Macro NO_CXX_EXCEPTION was removed from code.
Method Raise() was replaced by explicit throw statement.
Method Standard_Failure::Caught() was replaced by normal C++mechanism of exception transfer.
Method Standard_Failure::Caught() is deprecated now.
Eliminated empty constructors.
Updated samples.
Eliminate empty method ChangeValue from NCollection_Map class.
Removed not operable methods from NCollection classes.
This commit is contained in:
ski
2017-02-02 16:35:21 +03:00
committed by apn
parent 0c63f2f8b9
commit 9775fa6110
1146 changed files with 4860 additions and 6183 deletions

View File

@@ -515,7 +515,7 @@ void Draw::Load(Draw_Interpretor& theDI, const TCollection_AsciiString& theKey,
Standard_SStream aMsg; aMsg << "Could not find the resource:";
aMsg << theKey.ToCString()<< endl;
cout << "could not find the resource:"<<theKey.ToCString()<< endl;
Draw_Failure::Raise(aMsg);
throw Draw_Failure(aMsg.str().c_str());
}
TCollection_AsciiString aPluginLibrary("");
@@ -542,7 +542,7 @@ void Draw::Load(Draw_Interpretor& theDI, const TCollection_AsciiString& theKey,
#ifdef OCCT_DEBUG
cout << "could not open: " << aPluginResource->Value(theKey.ToCString())<< " ; reason: "<< error.ToCString() << endl;
#endif
Draw_Failure::Raise(aMsg);
throw Draw_Failure(aMsg.str().c_str());
}
f = aSharedLibrary.DlSymb("PLUGINFACTORY");
if( f == NULL ) {
@@ -550,7 +550,7 @@ void Draw::Load(Draw_Interpretor& theDI, const TCollection_AsciiString& theKey,
Standard_SStream aMsg; aMsg << "Could not find the factory in: ";
aMsg << aPluginResource->Value(theKey.ToCString());
aMsg << error.ToCString();
Draw_Failure::Raise(aMsg);
throw Draw_Failure(aMsg.str().c_str());
}
theMapOfFunctions.Bind(theKey, f);
}

View File

@@ -36,8 +36,8 @@ Standard_EXPORT const char* Draw_Eval (const char *theCommandStr)
cout << theCommands.Result() << endl;
return theCommands.Result();
}
catch (Standard_Failure)
catch (Standard_Failure const& anException)
{
return Standard_Failure::Caught()->GetMessageString();
return anException.GetMessageString();
}
}

View File

@@ -27,7 +27,7 @@ DEFINE_STANDARD_HANDLE(Draw_Failure, Standard_Failure)
#if !defined No_Exception && !defined No_Draw_Failure
#define Draw_Failure_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Draw_Failure::Raise(MESSAGE);
if (CONDITION) throw Draw_Failure(MESSAGE);
#else
#define Draw_Failure_Raise_if(CONDITION, MESSAGE)
#endif

View File

@@ -167,10 +167,7 @@ static Standard_Integer CommandCmd
if (fres != 0)
code = TCL_ERROR;
}
catch (Standard_Failure) {
Handle(Standard_Failure) E = Standard_Failure::Caught();
catch (Standard_Failure const& anException) {
// fail if Draw_ExitOnCatch is set
// MKV 29.03.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
@@ -181,7 +178,7 @@ static Standard_Integer CommandCmd
"Draw_ExitOnCatch",TCL_GLOBAL_ONLY);
#endif
cout << "An exception was caught " << E << endl;
cout << "An exception was caught " << anException << endl;
if (cc && Draw::Atoi(cc)) {
#ifdef _WIN32
@@ -193,7 +190,7 @@ static Standard_Integer CommandCmd
// get the error message
Standard_SStream ss;
ss << "** Exception ** " << E << ends;
ss << "** Exception ** " << anException << ends;
Tcl_SetResult(interp,(char*)(ss.str().c_str()),TCL_VOLATILE);
code = TCL_ERROR;
}