1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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

@@ -46,7 +46,7 @@ IGESData_IGESDumper::IGESData_IGESDumper
if (!ent.IsNull()) {
if (themodel.IsNull()) S<<" D??? ";
else if ( (num = themodel->Number(ent)) == 0) S<<" 0:D?????";
// Interface_InterfaceError::Raise ("IGESDumper : PrintDNum");
// throw Interface_InterfaceError("IGESDumper : PrintDNum");
else {
S<<Interface_MSG::Blanks(num,9)<<num<<":D"<<2*num-1<<Interface_MSG::Blanks(2*num-1,9);
}

View File

@@ -337,13 +337,12 @@ Standard_Boolean IGESData_IGESEntity::CResValues (const Standard_CString res1,
Handle(IGESData_IGESEntity) IGESData_IGESEntity::UniqueParent () const
{
if (NbTypedProperties(STANDARD_TYPE(IGESData_SingleParentEntity)) != 1)
Interface_InterfaceError::Raise ("IGESEntity : UniqueParent");
throw Interface_InterfaceError("IGESEntity : UniqueParent");
else {
DeclareAndCast(IGESData_SingleParentEntity,PP,
TypedProperty(STANDARD_TYPE(IGESData_SingleParentEntity)));
return PP->SingleParent();
}
return this; // ne rime a rien (cf exception) mais calme le compilateur
}

View File

@@ -171,13 +171,13 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
void IGESData_IGESWriter::SectionS ()
{
if (thesect != 0) Interface_InterfaceError::Raise("IGESWriter : SectionS");
if (thesect != 0) throw Interface_InterfaceError("IGESWriter : SectionS");
thesect = 1;
}
void IGESData_IGESWriter::SectionG (const IGESData_GlobalSection& header)
{
if (thesect != 1) Interface_InterfaceError::Raise("IGESWriter : SectionG");
if (thesect != 1) throw Interface_InterfaceError("IGESWriter : SectionG");
thesect = 2;
thesep = header.Separator();
theendm = header.EndMark();
@@ -197,7 +197,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
void IGESData_IGESWriter::SectionsDP ()
{
if (thesect != 2) Interface_InterfaceError::Raise("IGESWriter : SectionsDP");
if (thesect != 2) throw Interface_InterfaceError("IGESWriter : SectionsDP");
thesect = 3;
thecurr.SetMax (MaxcarsP);
thestep = IGESData_ReadEnd;
@@ -205,7 +205,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
void IGESData_IGESWriter::SectionT ()
{
if (thesect != 3) Interface_InterfaceError::Raise("IGESWriter : SectionT");
if (thesect != 3) throw Interface_InterfaceError("IGESWriter : SectionT");
thesect = 4;
thepnum.SetValue(thepnum.Length(),thepars->Length()+1);
}
@@ -215,7 +215,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
(const Handle(IGESData_IGESEntity)& anent)
{
if (thesect != 3 && thestep != IGESData_ReadEnd)
Interface_InterfaceError::Raise("IGESWriter : DirPart");
throw Interface_InterfaceError("IGESWriter : DirPart");
Standard_Integer v[17]; Standard_Character res1[9],res2[9],label[9],snum[9];
Standard_Integer nument = themodel->Number(anent);
if (nument == 0) return;
@@ -289,7 +289,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
{
char text[20];
if (thesect != 3 && thestep != IGESData_ReadDir)
Interface_InterfaceError::Raise("IGESWriter : OwnParams");
throw Interface_InterfaceError("IGESWriter : OwnParams");
thepnum.SetValue(themodel->Number(anent),thepars->Length()+1);
thecurr.Clear();
sprintf(text,"%d",anent->TypeNumber());
@@ -301,7 +301,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
(const Handle(IGESData_IGESEntity)& anent)
{
if (thesect != 3 && thestep != IGESData_ReadOwn)
Interface_InterfaceError::Raise("IGESWriter : Properties");
throw Interface_InterfaceError("IGESWriter : Properties");
thestep = IGESData_ReadProps;
if (!anent->ArePresentProperties()) return;
Send(anent->NbProperties());
@@ -316,7 +316,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
(const Handle(IGESData_IGESEntity)& anent)
{
if (thesect != 3 && thestep != IGESData_ReadOwn)
Interface_InterfaceError::Raise("IGESWriter : Associativities");
throw Interface_InterfaceError("IGESWriter : Associativities");
thestep = IGESData_ReadAssocs;
if (!anent->ArePresentAssociativities() && !anent->ArePresentProperties())
return; // Properties suivent : ne pas les omettre !
@@ -332,7 +332,7 @@ void IGESData_IGESWriter::SendStartLine (const Standard_CString startline)
void IGESData_IGESWriter::EndEntity ()
{
if (thesect != 3 && thestep != IGESData_ReadOwn)
Interface_InterfaceError::Raise("IGESWriter : EndEntity");
throw Interface_InterfaceError("IGESWriter : EndEntity");
AddChar(theendm);
if (thecurr.Length() > 0) thepars->Append(thecurr.Moved());
thestep = IGESData_ReadEnd;
@@ -496,8 +496,7 @@ Standard_Boolean IGESData_IGESWriter::Print (Standard_OStream& S) const
blancs[i] = (char)(blancs[i] ^ (150 + (i & 3)));
}
if (thesect != 4) Interface_InterfaceError::Raise
("IGESWriter not ready for Print");
if (thesect != 4) throw Interface_InterfaceError("IGESWriter not ready for Print");
// Start Section (assez simple, somme toute). Attention si commentaires
Handle(TCollection_HAsciiString) line;
Standard_Integer nbs = 1;

View File

@@ -37,8 +37,7 @@ IGESData_ParamCursor::IGESData_ParamCursor (const Standard_Integer num)
theoffst += thetsize;
thetsize = size;
if (autoadv) theadv = (theoffst + thetsize == theisize);
if (theoffst + thetsize > theisize) Interface_InterfaceError::Raise
("IGESDAta ParamCursor : required Term size overpass whole Item size");
if (theoffst + thetsize > theisize) throw Interface_InterfaceError("IGESDAta ParamCursor : required Term size overpass whole Item size");
}
void IGESData_ParamCursor::SetOne (const Standard_Boolean autoadv)

View File

@@ -153,10 +153,8 @@ Standard_Boolean IGESData_ToolLocation::HasParent
{
Standard_Integer num = themodel->Number(ent);
if (num == 0) return Standard_False;
if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise
("IGESData_ToolLocation : HasParent");
if (therefs(num) != 0 && theassocs(num) != 0) Standard_DomainError::Raise
("IGESData_ToolLocation : HasParent");
if (therefs(num) < 0 || theassocs(num) < 0) throw Standard_DomainError("IGESData_ToolLocation : HasParent");
if (therefs(num) != 0 && theassocs(num) != 0) throw Standard_DomainError("IGESData_ToolLocation : HasParent");
if (therefs(num) != 0 || theassocs(num) != 0) return Standard_True;
return Standard_False;
}
@@ -167,10 +165,8 @@ Handle(IGESData_IGESEntity) IGESData_ToolLocation::Parent
Handle(IGESData_IGESEntity) parent;
Standard_Integer num = themodel->Number(ent);
if (num == 0) return parent;
if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise
("IGESData_ToolLocation : Parent");
if (therefs(num) != 0 && theassocs(num) != 0) Standard_DomainError::Raise
("IGESData_ToolLocation : Parent");
if (therefs(num) < 0 || theassocs(num) < 0) throw Standard_DomainError("IGESData_ToolLocation : Parent");
if (therefs(num) != 0 && theassocs(num) != 0) throw Standard_DomainError("IGESData_ToolLocation : Parent");
if (therefs(num) != 0) parent = themodel->Entity (therefs (num));
if (theassocs(num) != 0) parent = themodel->Entity (theassocs (num));
return parent;
@@ -181,10 +177,8 @@ Standard_Boolean IGESData_ToolLocation::HasParentByAssociativity
{
Standard_Integer num = themodel->Number(ent);
if (num == 0) return Standard_False;
if (therefs(num) < 0 || theassocs(num) < 0) Standard_DomainError::Raise
("IGESData_ToolLocation : HasParentByAssociativity");
if (therefs(num) != 0 && theassocs(num) != 0) Standard_DomainError::Raise
("IGESData_ToolLocation : HasParentByAssociativity");
if (therefs(num) < 0 || theassocs(num) < 0) throw Standard_DomainError("IGESData_ToolLocation : HasParentByAssociativity");
if (therefs(num) != 0 && theassocs(num) != 0) throw Standard_DomainError("IGESData_ToolLocation : HasParentByAssociativity");
if (theassocs(num) != 0) return Standard_True;
return Standard_False;
}