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

@@ -143,7 +143,7 @@ Standard_Integer Interface_Check::NbFails () const
const Handle(TCollection_HAsciiString)& Interface_Check::Fail
(const Standard_Integer num, const Standard_Boolean final) const
{
if (thefails.IsNull()) Standard_OutOfRange::Raise();
if (thefails.IsNull()) throw Standard_OutOfRange();
return (final ? thefails->Value(num) : thefailo->Value(num));
}
@@ -271,7 +271,7 @@ Standard_Integer Interface_Check::NbWarnings () const
const Handle(TCollection_HAsciiString)& Interface_Check::Warning
(const Standard_Integer num, const Standard_Boolean final) const
{
if (thewarns.IsNull()) Standard_OutOfRange::Raise();
if (thewarns.IsNull()) throw Standard_OutOfRange();
return (final ? thewarns->Value(num) : thewarno->Value(num));
}
@@ -341,7 +341,7 @@ Standard_Integer Interface_Check::NbInfoMsgs () const
const Handle(TCollection_HAsciiString)& Interface_Check::InfoMsg
(const Standard_Integer num, const Standard_Boolean final) const
{
if (theinfos.IsNull()) Standard_OutOfRange::Raise();
if (theinfos.IsNull()) throw Standard_OutOfRange();
return (final ? theinfos->Value(num) : theinfoo->Value(num));
}

View File

@@ -27,7 +27,7 @@ DEFINE_STANDARD_HANDLE(Interface_CheckFailure, Interface_InterfaceError)
#if !defined No_Exception && !defined No_Interface_CheckFailure
#define Interface_CheckFailure_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Interface_CheckFailure::Raise(MESSAGE);
if (CONDITION) throw Interface_CheckFailure(MESSAGE);
#else
#define Interface_CheckFailure_Raise_if(CONDITION, MESSAGE)
#endif

View File

@@ -436,8 +436,7 @@ void Interface_CheckIterator::Next () const
const Handle(Interface_Check)& Interface_CheckIterator::Value () const
{
if (thecurr->Value() > thelist->Length()) Standard_NoSuchObject::Raise
("Interface Check Iterator : Value");
if (thecurr->Value() > thelist->Length()) throw Standard_NoSuchObject("Interface Check Iterator : Value");
return thelist->Value(thecurr->Value());
}
@@ -449,8 +448,7 @@ const Handle(Interface_Check)& Interface_CheckIterator::Value () const
Standard_Integer Interface_CheckIterator::Number () const
{
if (thecurr->Value() > thenums->Length()) Standard_NoSuchObject::Raise
("Interface Check Iterator : Value");
if (thecurr->Value() > thenums->Length()) throw Standard_NoSuchObject("Interface Check Iterator : Value");
return thenums->Value(thecurr->Value());
}

View File

@@ -42,19 +42,20 @@
static int errh = 1;
static void raisecheck (Handle(Interface_Check)& ach)
static void raisecheck (Standard_Failure& theException,Handle(Interface_Check)& ach)
{
Handle(Standard_Failure) afail = Standard_Failure::Caught();
char mess[100];
sprintf (mess,"** Exception Raised during Check : %s **",
afail->DynamicType()->Name());
theException.DynamicType()->Name());
ach->AddFail(mess);
#ifdef _WIN32
if (afail->IsKind(STANDARD_TYPE(OSD_Exception)))
if (theException.IsKind(STANDARD_TYPE(OSD_Exception))) {
#else
if (afail->IsKind(STANDARD_TYPE(OSD_Signal)))
if (theException.IsKind(STANDARD_TYPE(OSD_Signal))) {
#endif
afail->Reraise("System Signal received, check interrupt");
theException.SetMessageString("System Signal received, check interrupt");
throw theException;
}
}
@@ -134,8 +135,8 @@ void Interface_CheckTool::FillCheck(const Handle(Standard_Transient)& ent,
OCC_CATCH_SIGNALS
module->CheckCase(CN,ent,sh,ach);
}
catch (Standard_Failure) {
raisecheck(ach);
catch (Standard_Failure& anException) {
raisecheck(anException,ach);
}
}
else {
@@ -216,23 +217,20 @@ Handle(Interface_Check) Interface_CheckTool::Check(const Standard_Integer num)
void Interface_CheckTool::CheckSuccess (const Standard_Boolean reset)
{
if (reset) thestat = 0;
if (thestat > 3) Interface_CheckFailure::Raise // deja teste avec erreur
if (thestat > 3) throw Interface_CheckFailure // deja teste avec erreur
("Interface Model : Global Check");
Handle(Interface_InterfaceModel) model = theshare.Model();
if (model->GlobalCheck()->NbFails() > 0) Interface_CheckFailure::Raise
("Interface Model : Global Check");
if (model->GlobalCheck()->NbFails() > 0) throw Interface_CheckFailure("Interface Model : Global Check");
Handle(Interface_Check) modchk = new Interface_Check;
model->VerifyCheck(modchk);
if (!model->Protocol().IsNull()) model->Protocol()->GlobalCheck (theshare.Graph(),modchk);
if (modchk->HasFailed()) Interface_CheckFailure::Raise
("Interface Model : Verify Check");
if (modchk->HasFailed()) throw Interface_CheckFailure("Interface Model : Verify Check");
if (thestat == 3) return; // tout teste et ca passe
errh = 0; // Pas de try/catch, car justement on raise
Standard_Integer nb = model->NbEntities();
for (Standard_Integer i = 1; i <= nb; i ++) {
if (model->IsErrorEntity(i)) Interface_CheckFailure::Raise
("Interface Model : an Entity is recorded as Erroneous");
if (model->IsErrorEntity(i)) throw Interface_CheckFailure("Interface Model : an Entity is recorded as Erroneous");
Handle(Standard_Transient) ent = model->Value(i);
if (thestat & 1) {
if (!model->IsErrorEntity(i)) continue; // deja verify, reste analyse
@@ -243,8 +241,7 @@ void Interface_CheckTool::CheckSuccess (const Standard_Boolean reset)
Handle(Interface_Check) ach = new Interface_Check(ent);
FillCheck(ent,theshare,ach);
if (ach->HasFailed()) Interface_CheckFailure::Raise
("Interface Model : Check on an Entity has Failed");
if (ach->HasFailed()) throw Interface_CheckFailure("Interface Model : Check on an Entity has Failed");
}
}
@@ -293,9 +290,9 @@ Interface_CheckIterator Interface_CheckTool::CompleteCheckList ()
}
n0 = nb+1;
}
catch(Standard_Failure) {
catch(Standard_Failure& anException) {
n0 = i+1;
raisecheck(ach);
raisecheck(anException,ach);
res.Add(ach,i); thestat |= 12;
}
}
@@ -345,9 +342,9 @@ Interface_CheckIterator Interface_CheckTool::CheckList ()
}
n0 = nb+1;
}
catch(Standard_Failure) {
catch(Standard_Failure& anException) {
n0 = i+1;
raisecheck(ach);
raisecheck(anException,ach);
res.Add(ach,i); thestat |= 12;
}
}
@@ -385,9 +382,9 @@ Interface_CheckIterator Interface_CheckTool::AnalyseCheckList ()
}
n0 = nb+1;
}
catch(Standard_Failure) {
catch(Standard_Failure& anException) {
n0 = i+1;
raisecheck(ach);
raisecheck(anException,ach);
res.Add(ach,i); thestat |= 8;
}
}
@@ -429,9 +426,9 @@ Interface_CheckIterator Interface_CheckTool::VerifyCheckList ()
}
n0 = nb+1;
}
catch(Standard_Failure) {
catch(Standard_Failure& anException) {
n0 = i+1;
raisecheck(ach);
raisecheck(anException,ach);
res.Add(ach,i); thestat |= 4;
}
}
@@ -477,9 +474,9 @@ Interface_CheckIterator Interface_CheckTool::WarningCheckList ()
}
n0 = nb+1;
}
catch(Standard_Failure) {
catch(Standard_Failure& anException) {
n0 = i+1;
raisecheck(ach);
raisecheck(anException,ach);
res.Add(ach,i); thestat |= 12;
}
}

View File

@@ -42,10 +42,8 @@ Interface_CopyMap::Interface_CopyMap
const Handle(Standard_Transient)& res)
{
Standard_Integer num = themod->Number(ent);
if (num == 0 || num > theres.Upper()) Interface_InterfaceError::Raise
("CopyMap : Bind, Starting Entity not issued from Starting Model");
if (!theres.Value(num).IsNull()) Interface_InterfaceError::Raise
("CopyMap : Bind, Starting Entity already bound");
if (num == 0 || num > theres.Upper()) throw Interface_InterfaceError("CopyMap : Bind, Starting Entity not issued from Starting Model");
if (!theres.Value(num).IsNull()) throw Interface_InterfaceError("CopyMap : Bind, Starting Entity already bound");
theres.SetValue(num,res);
}

View File

@@ -65,8 +65,7 @@ Interface_CopyTool::Interface_CopyTool
(const Handle(Interface_InterfaceModel)& amodel)
: thelib (Interface_Protocol::Active()) , thelst (amodel->NbEntities())
{
if (Interface_Protocol::Active().IsNull()) Interface_InterfaceError::Raise
("Interface CopyTool : Create with Active Protocol undefined");
if (Interface_Protocol::Active().IsNull()) throw Interface_InterfaceError("Interface CopyTool : Create with Active Protocol undefined");
thelst.Init(Standard_False);
themod = amodel;
@@ -172,8 +171,7 @@ Interface_CopyTool::Interface_CopyTool
// <nument> == 0 -> Peut etre une sous-partie non partagee ...
// On accepte mais on se protege contre un bouclage
if (nument == 0 && thelev > 100) Interface_InterfaceError::Raise
("CopyTool : Transferred, Entity is not contained in Starting Model");
if (nument == 0 && thelev > 100) throw Interface_InterfaceError("CopyTool : Transferred, Entity is not contained in Starting Model");
if (!themap->Search(ent,res)) { // deja transfere ? sinon, le faire
// On opere la Copie (enfin, on tente)

View File

@@ -49,7 +49,7 @@ Interface_EntityCluster::Interface_EntityCluster () { }
void Interface_EntityCluster::Append
(const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityCluster Append");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster Append");
if (theents[0].IsNull()) theents[0] = ent;
else if (theents[1].IsNull()) theents[1] = ent;
else if (theents[2].IsNull()) theents[2] = ent;
@@ -63,7 +63,7 @@ Interface_EntityCluster::Interface_EntityCluster () { }
Standard_Boolean Interface_EntityCluster::Remove
(const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityCluster Remove");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster Remove");
Standard_Integer i;
// <ent> est-il ici ? si oui, on a son rang
if (ent == theents[0]) i = 1;
@@ -85,10 +85,10 @@ Interface_EntityCluster::Interface_EntityCluster () { }
Standard_Boolean Interface_EntityCluster::Remove
(const Standard_Integer num)
{
if (num < 1) Standard_OutOfRange::Raise("EntityCluster : Remove");
if (num < 1) throw Standard_OutOfRange("EntityCluster : Remove");
Standard_Integer n = NbLocal();
if (num > n) {
if (thenext.IsNull()) Standard_OutOfRange::Raise("EntityCluster : Remove");
if (thenext.IsNull()) throw Standard_OutOfRange("EntityCluster : Remove");
Standard_Boolean res = thenext->Remove (num-n);
if (res) thenext = thenext->Next();
return Standard_False;
@@ -111,10 +111,9 @@ Interface_EntityCluster::Interface_EntityCluster () { }
(const Standard_Integer num) const
{
Standard_Integer nb = NbLocal();
if (num <= 0) Standard_OutOfRange::Raise("Interface EntityCluster : Value");
if (num <= 0) throw Standard_OutOfRange("Interface EntityCluster : Value");
if (num > nb) {
if (thenext.IsNull()) Standard_OutOfRange::Raise
("Interface EntityCluster : Value");
if (thenext.IsNull()) throw Standard_OutOfRange("Interface EntityCluster : Value");
return thenext->Value(num-nb);
}
return theents[num-1]; // numerotation a partir de 0
@@ -123,12 +122,11 @@ Interface_EntityCluster::Interface_EntityCluster () { }
void Interface_EntityCluster::SetValue
(const Standard_Integer num, const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityCluster SetValue");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityCluster SetValue");
Standard_Integer nb = NbLocal();
if (num <= 0) Standard_OutOfRange::Raise("Interface EntityCluster : SetValue");
if (num <= 0) throw Standard_OutOfRange("Interface EntityCluster : SetValue");
if (num > nb) {
if (thenext.IsNull()) Standard_OutOfRange::Raise
("Interface EntityCluster : SetValue");
if (thenext.IsNull()) throw Standard_OutOfRange("Interface EntityCluster : SetValue");
thenext->SetValue(num-nb,ent);
}
else theents[num-1] = ent; // numerotation a partir de 0

View File

@@ -137,9 +137,9 @@ Interface_EntityIterator::Interface_EntityIterator ()
const Handle(Standard_Transient)& Interface_EntityIterator::Value () const
{
// NbEntity pas const (on ne sait pas comment il est implemente apres tout)
if (thelist.IsNull()) Standard_NoSuchObject::Raise("Interface_EntityIterator");
if (thelist.IsNull()) throw Standard_NoSuchObject("Interface_EntityIterator");
if (thecurr->Value() < 1 || thecurr->Value() > thelist->Length())
Standard_NoSuchObject::Raise("Interface_EntityIterator");
throw Standard_NoSuchObject("Interface_EntityIterator");
return thelist->Value(thecurr->Value());
}

View File

@@ -35,7 +35,7 @@ Interface_EntityList::Interface_EntityList () { }
void Interface_EntityList::Append
(const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Append");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList Append");
if (theval.IsNull()) { theval = ent; return; }
Handle(Interface_EntityCluster) aValEC =
Handle(Interface_EntityCluster)::DownCast(theval);
@@ -55,7 +55,7 @@ Interface_EntityList::Interface_EntityList () { }
void Interface_EntityList::Add
(const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Add");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList Add");
if (theval.IsNull()) { theval = ent; return; }
Handle(Interface_EntityCluster) aValEC =
Handle(Interface_EntityCluster)::DownCast(theval);
@@ -75,7 +75,7 @@ Interface_EntityList::Interface_EntityList () { }
void Interface_EntityList::Remove (const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList Remove");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList Remove");
if (theval.IsNull()) return;
if (theval == ent) {
theval.Nullify();
@@ -92,11 +92,11 @@ Interface_EntityList::Interface_EntityList () { }
void Interface_EntityList::Remove (const Standard_Integer num)
{
if (theval.IsNull()) Standard_OutOfRange::Raise("EntityList : Remove");
if (theval.IsNull()) throw Standard_OutOfRange("EntityList : Remove");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (ec.IsNull()) {
if (num != 1) Standard_OutOfRange::Raise("EntityList : Remove");
if (num != 1) throw Standard_OutOfRange("EntityList : Remove");
theval.Nullify();
return;
}
@@ -122,23 +122,23 @@ Interface_EntityList::Interface_EntityList () { }
const Handle(Standard_Transient)& Interface_EntityList::Value
(const Standard_Integer num) const
{
if (theval.IsNull()) Standard_OutOfRange::Raise("Interface EntityList : Value");
if (theval.IsNull()) throw Standard_OutOfRange("Interface EntityList : Value");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (!ec.IsNull()) return ec->Value(num); // EntityCluster
else if (num != 1) Standard_OutOfRange::Raise("Interface EntityList : Value");
else if (num != 1) throw Standard_OutOfRange("Interface EntityList : Value");
return theval;
}
void Interface_EntityList::SetValue
(const Standard_Integer num, const Handle(Standard_Transient)& ent)
{
if (ent.IsNull()) Standard_NullObject::Raise("Interface_EntityList SetValue");
if (theval.IsNull()) Standard_OutOfRange::Raise("Interface EntityList : SetValue");
if (ent.IsNull()) throw Standard_NullObject("Interface_EntityList SetValue");
if (theval.IsNull()) throw Standard_OutOfRange("Interface EntityList : SetValue");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (!ec.IsNull()) ec->SetValue(num,ent); // EntityCluster
else if (num != 1) Standard_OutOfRange::Raise("Interface EntityList : SetValue");
else if (num != 1) throw Standard_OutOfRange("Interface EntityList : SetValue");
else theval = ent;
}
@@ -182,8 +182,7 @@ Interface_EntityList::Interface_EntityList () { }
{
Standard_Integer res = 0;
Handle(Standard_Transient) entres;
if (theval.IsNull()) Interface_InterfaceError::Raise
("Interface EntityList : TypedEntity , none found");
if (theval.IsNull()) throw Interface_InterfaceError("Interface EntityList : TypedEntity , none found");
Handle(Interface_EntityCluster) ec =
Handle(Interface_EntityCluster)::DownCast(theval);
if (!ec.IsNull()) { // EntityCluster
@@ -191,8 +190,7 @@ Interface_EntityList::Interface_EntityList () { }
for (Standard_Integer i = ec->NbLocal(); i > 0; i --) {
if (ec->Value(i)->IsKind(atype)) {
res ++;
if (num == 0 && res > 1) Interface_InterfaceError::Raise
("Interface EntityList : TypedEntity , several found");
if (num == 0 && res > 1) throw Interface_InterfaceError("Interface EntityList : TypedEntity , several found");
entres = ec->Value(i);
if (res == num) return entres;
}
@@ -201,11 +199,9 @@ Interface_EntityList::Interface_EntityList () { }
ec = ec->Next();
}
} else if (num > 1) {
Interface_InterfaceError::Raise
("Interface EntityList : TypedEntity ,out of range");
throw Interface_InterfaceError("Interface EntityList : TypedEntity ,out of range");
} else { // InterfaceEntity
if (!theval->IsKind(atype)) Interface_InterfaceError::Raise
("Interface EntityList : TypedEntity , none found");
if (!theval->IsKind(atype)) throw Interface_InterfaceError("Interface EntityList : TypedEntity , none found");
entres = theval;
}
return entres;

View File

@@ -380,15 +380,14 @@ void Interface_FileReaderTool::LoadModel
// En cas d erreur NON PREVUE par l analyse, recuperation par defaut
// Attention : la recuperation peut elle-meme planter ... (cf ierr)
catch (Standard_Failure) {
catch (Standard_Failure const& anException) {
// Au passage suivant, on attaquera le record suivant
num0 = thereader->FindNextRecord(num); //:g9 abv 28 May 98: tr8_as2_ug.stp - infinite cycle: (0);
Handle(Standard_Failure) afail = Standard_Failure::Caught();
#ifdef _WIN32
if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Exception))) ierr = 2;
if (anException.IsKind(STANDARD_TYPE(OSD_Exception))) ierr = 2;
#else
if (afail.IsNull() || afail->IsKind(STANDARD_TYPE(OSD_Signal))) ierr = 2;
if (anException.IsKind(STANDARD_TYPE(OSD_Signal))) ierr = 2;
#endif
//:abv 03Apr00: anent is actually a previous one: if (anent.IsNull())
anent = thereader->BoundEntity(num);

View File

@@ -363,8 +363,7 @@ void Interface_Graph::GetFromIter
void Interface_Graph::GetFromGraph (const Interface_Graph& agraph)
{
if (Model() != agraph.Model()) Standard_DomainError::Raise
("Graph from Interface : GetFromGraph");
if (Model() != agraph.Model()) throw Standard_DomainError("Graph from Interface : GetFromGraph");
Standard_Integer nb = Size();
for (Standard_Integer i = 1; i <= nb; i ++) {
if (agraph.IsPresent(i))
@@ -375,8 +374,7 @@ void Interface_Graph::GetFromGraph (const Interface_Graph& agraph)
void Interface_Graph::GetFromGraph
(const Interface_Graph& agraph, const Standard_Integer stat)
{
if (Model() != agraph.Model()) Standard_DomainError::Raise
("Graph from Interface : GetFromGraph");
if (Model() != agraph.Model()) throw Standard_DomainError("Graph from Interface : GetFromGraph");
Standard_Integer nb = Size();
for (Standard_Integer i = 1; i <= nb; i ++) {
if (agraph.IsPresent(i) && agraph.Status(i) == stat)
@@ -410,7 +408,7 @@ Interface_EntityIterator Interface_Graph::Shareds
if (themodel->IsRedefinedContent(num))
aCurEnt = themodel->ReportEntity(num)->Content();
//if (num == 0) Standard_DomainError::Raise ("Interface : Shareds");
//if (num == 0) throw Standard_DomainError("Interface : Shareds");
Handle(Interface_GeneralModule) module;
Standard_Integer CN;
if (themodel->GTool()->Select(aCurEnt,module,CN))

View File

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

View File

@@ -27,7 +27,7 @@ DEFINE_STANDARD_HANDLE(Interface_InterfaceMismatch, Interface_InterfaceError)
#if !defined No_Exception && !defined No_Interface_InterfaceMismatch
#define Interface_InterfaceMismatch_Raise_if(CONDITION, MESSAGE) \
if (CONDITION) Interface_InterfaceMismatch::Raise(MESSAGE);
if (CONDITION) throw Interface_InterfaceMismatch(MESSAGE);
#else
#define Interface_InterfaceMismatch_Raise_if(CONDITION, MESSAGE)
#endif

View File

@@ -431,18 +431,15 @@ Standard_Boolean Interface_InterfaceModel::SetReportEntity
Handle(Standard_Transient) ent;
if (num > 0) {
ent = Value(nm);
if (! (ent == rep->Concerned()) ) Interface_InterfaceMismatch::Raise
("InterfaceModel : SetReportEntity");
if (! (ent == rep->Concerned()) ) throw Interface_InterfaceMismatch("InterfaceModel : SetReportEntity");
} else if (num < 0) {
nm = -num;
ent = Value(nm);
if (! (ent == rep->Concerned()) ) Interface_InterfaceMismatch::Raise
("InterfaceModel : SetReportEntity");
if (! (ent == rep->Concerned()) ) throw Interface_InterfaceMismatch("InterfaceModel : SetReportEntity");
} else {
ent = rep->Concerned();
nm = Number (ent);
if (nm == 0) Interface_InterfaceMismatch::Raise
("InterfaceModel : SetReportEntity");
if (nm == 0) throw Interface_InterfaceMismatch("InterfaceModel : SetReportEntity");
}
if (!thereports.IsBound(nm)) {
Standard_Integer maxrep = thereports.NbBuckets();
@@ -624,8 +621,7 @@ void Interface_InterfaceModel::AddWithRefs(const Handle(Standard_Transient)& ane
const Standard_Boolean listall)
{
Handle(Interface_Protocol) proto = Protocol();
if (proto.IsNull()) Interface_InterfaceMismatch::Raise
("InterfaceModel : AddWithRefs");
if (proto.IsNull()) throw Interface_InterfaceMismatch("InterfaceModel : AddWithRefs");
AddWithRefs (anent,proto,level,listall);
}
@@ -726,8 +722,7 @@ void Interface_InterfaceModel::ChangeOrder(const Standard_Integer oldnum,
Standard_Integer minum = (oldnum > newnum ? newnum : oldnum);
Standard_Integer mxnum = (oldnum < newnum ? newnum : oldnum);
Standard_Integer kount = (oldnum > newnum ? cnt : -cnt);
if (cnt <= 0 || cnt > mxnum - minum) Interface_InterfaceMismatch::Raise
("InterfaceModel : ChangeOrder, Overlap");
if (cnt <= 0 || cnt > mxnum - minum) throw Interface_InterfaceMismatch("InterfaceModel : ChangeOrder, Overlap");
for (i = 1; i < minum; i ++) ents.SetValue (i,theentities.FindKey(i));
for (i = mxnum+cnt; i <= nb; i ++) ents.SetValue (i,theentities.FindKey(i));
for (i = minum; i < mxnum; i ++)

View File

@@ -28,8 +28,7 @@ Interface_LineBuffer::Interface_LineBuffer (const Standard_Integer size)
void Interface_LineBuffer::SetMax (const Standard_Integer max)
{
if (max > theline.Length()) Standard_OutOfRange::Raise
("Interface LineBuffer : SetMax");
if (max > theline.Length()) throw Standard_OutOfRange("Interface LineBuffer : SetMax");
if (max <= 0) themax = theline.Length();
else themax = max;
}
@@ -38,8 +37,7 @@ Interface_LineBuffer::Interface_LineBuffer (const Standard_Integer size)
void Interface_LineBuffer::SetInitial (const Standard_Integer initial)
{
if (thefriz > 0) return;
if (initial >= themax) Standard_OutOfRange::Raise
("Interface LineBuffer : SetInitial");
if (initial >= themax) throw Standard_OutOfRange("Interface LineBuffer : SetInitial");
if (initial <= 0) theinit = 0;
else theinit = initial;
}

View File

@@ -192,7 +192,7 @@ Standard_CString Interface_MSG::Translated (const Standard_CString key)
} else
thelist.Bind(key, 1);
}
if (theraise) Standard_DomainError::Raise ("Interface_MSG : Translate");
if (theraise) throw Standard_DomainError("Interface_MSG : Translate");
return key;
}
@@ -216,7 +216,7 @@ void Interface_MSG::Record
dup = new TCollection_HAsciiString(item);
thedup->Append(dup);
}
if (theraise) Standard_DomainError::Raise ("Interface_MSG : Record");
if (theraise) throw Standard_DomainError("Interface_MSG : Record");
}

View File

@@ -47,8 +47,7 @@ Interface_Recognizer::Interface_Recognizer ()
{
if (!theres.IsNull()) return theres;
if (hasnext) return thenext->Result();
Standard_NoSuchObject::Raise ("Recognizer evaluation has failed");
return theres; // pour calmer le compilateur
throw Standard_NoSuchObject("Recognizer evaluation has failed");
}
void Interface_Recognizer::Add (const Handle(Interface_Recognizer)& reco)

View File

@@ -127,8 +127,7 @@ Interface_ShareFlags::Interface_ShareFlags
(const Handle(Standard_Transient)& ent) const
{
Standard_Integer num = themodel->Number(ent);
if (num == 0 || num > themodel->NbEntities()) Standard_DomainError::Raise
("Interface ShareFlags : IsShared");
if (num == 0 || num > themodel->NbEntities()) throw Standard_DomainError("Interface ShareFlags : IsShared");
return theflags.Value(num);
}

View File

@@ -149,12 +149,10 @@ Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgrap
if (entsh->IsKind(atype)) {
entresult = entsh;
result ++;
if (result > 1) Interface_InterfaceError::Raise
("Interface ShareTool : TypedSharing, more than one found");
if (result > 1) throw Interface_InterfaceError("Interface ShareTool : TypedSharing, more than one found");
}
}
if (result == 0) Interface_InterfaceError::Raise
("Interface ShareTool : TypedSharing, not found");
if (result == 0) throw Interface_InterfaceError("Interface ShareTool : TypedSharing, not found");
return entresult;
}

View File

@@ -96,7 +96,7 @@ void Interface_Static::Standards ()
}
if (!Message_MsgFile::HasMsg ("XSTEP_1"))
{
Standard_ProgramError::Raise ("Critical Error - message resources for Interface_Static are invalid or undefined!");
throw Standard_ProgramError("Critical Error - message resources for Interface_Static are invalid or undefined!");
}
}
}

View File

@@ -62,8 +62,7 @@ Interface_UndefinedContent::Interface_UndefinedContent () // Unknown
Handle(Standard_Transient)& ent,
Handle(TCollection_HAsciiString)& val) const
{
if (num < 1 || num > thenbparams) Standard_OutOfRange::Raise
("Interface UndefinedContent : ParamData");
if (num < 1 || num > thenbparams) throw Standard_OutOfRange("Interface UndefinedContent : ParamData");
Standard_Integer desc = theparams->Value(num);
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
ptype = Interface_ParamType (desc & Content_TypeField);
@@ -89,8 +88,7 @@ Interface_UndefinedContent::Interface_UndefinedContent () // Unknown
{
Standard_Integer desc = theparams->Value(num);
if (((desc >> Content_LocalShift) & Content_LocalField) != Content_LocalRef)
Interface_InterfaceError::Raise
("UndefinedContent : Param is not Entity type");
throw Interface_InterfaceError("UndefinedContent : Param is not Entity type");
return theentities.Value (desc >> Content_NumberShift);
}
@@ -100,8 +98,7 @@ Interface_UndefinedContent::ParamValue
{
Standard_Integer desc = theparams->Value(num);
if (((desc >> Content_LocalShift) & Content_LocalField) != 0)
Interface_InterfaceError::Raise
("UndefinedContent : Param is not literal");
throw Interface_InterfaceError("UndefinedContent : Param is not literal");
return thevalues->Value (desc >> Content_NumberShift);
}
@@ -284,7 +281,7 @@ Interface_UndefinedContent::ParamValue
Standard_Integer rang = desc >> Content_NumberShift;
Standard_Integer local = ((desc >> Content_LocalShift) & Content_LocalField);
Standard_Boolean c1ent = (local == Content_LocalRef);
if (!c1ent) Interface_InterfaceError::Raise("UndefinedContent : SetEntity");
if (!c1ent) throw Interface_InterfaceError("UndefinedContent : SetEntity");
theentities.SetValue(rang,ent);
}