#endif
#include <stdio.h>
-//static int errh = 1;
-
-static void raisecheck (Standard_Failure& theException,Handle(Interface_Check)& ach)
+void Interface_CheckTool::raisecheck (Standard_Failure& theException,Handle(Interface_Check)& ach)
{
char mess[100];
sprintf (mess,"** Exception Raised during Check : %s **",
theshare (model,protocol)
{
thestat = 0;
+ errh = 1;
}
{
thestat = 0;
thegtool->Reservate(model->NbEntities());
+ errh = 1;
}
Interface_CheckTool::Interface_CheckTool(const Interface_Graph& graph)
: thegtool(graph.Model()->GTool()) , theshare (graph)
{
+ errh = 1;
}
Interface_CheckTool::Interface_CheckTool(const Handle(Interface_HGraph)& hgraph)
: thegtool(hgraph->Graph().Model()->GTool()) , theshare (hgraph)
{
+ errh = 1;
}
#include <Message_MsgFile.hxx>
#include <TCollection_AsciiString.hxx>
#include <stdio.h>
+#include <Standard_Mutex.hxx>
typedef enum
{
Msg_IndefiniteType
} FormatType;
+// mutex used to prevent concurrent access to message registry
+static Standard_Mutex theMutex;
+
//=======================================================================
//function : Message_Msg()
//purpose : Constructor
Message_Msg::Message_Msg (const Message_Msg& theMsg)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
myMessageBody = theMsg.myMessageBody;
myOriginal = theMsg.myOriginal;
for ( Standard_Integer i = 1, n = theMsg.mySeqOfFormats.Length(); i <=n; i++ )
Message_Msg::Message_Msg (const Standard_CString theMsgCode)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
TCollection_AsciiString aKey((char*)theMsgCode);
Set ( Message_MsgFile::Msg(aKey) );
}
Message_Msg::Message_Msg (const TCollection_ExtendedString& theMsgCode)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
Set ( Message_MsgFile::Msg(theMsgCode) );
}
void Message_Msg::Set (const Standard_CString theMsg)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
TCollection_AsciiString aMsg((char*)theMsg);
Set ( aMsg );
}
void Message_Msg::Set (const TCollection_ExtendedString& theMsg)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
myMessageBody = theMsg;
const Standard_ExtString anExtString = myMessageBody.ToExtString();
Message_Msg& Message_Msg::Arg (const Standard_CString theString)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
// get location and format
TCollection_AsciiString aFormat;
Standard_Integer aFirst = getFormat ( Msg_StringType, aFormat );
Message_Msg& Message_Msg::Arg (const TCollection_ExtendedString& theString)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
// get location and format
TCollection_AsciiString aFormat;
Standard_Integer aFirst = getFormat ( Msg_StringType, aFormat );
Message_Msg& Message_Msg::Arg (const Standard_Integer theValue)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
// get location and format
TCollection_AsciiString aFormat;
Standard_Integer aFirst = getFormat ( Msg_IntegerType, aFormat );
Message_Msg& Message_Msg::Arg (const Standard_Real theValue)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
// get location and format
TCollection_AsciiString aFormat;
Standard_Integer aFirst = getFormat ( Msg_RealType, aFormat );
const TCollection_ExtendedString& Message_Msg::Get ()
{
+ Standard_Mutex::Sentry aSentry(theMutex);
// remove all non-initialised format specifications
Standard_Integer i, anIncrement = 0;
static const TCollection_ExtendedString anUnknown ("UNKNOWN");
Standard_Integer Message_Msg::getFormat (const Standard_Integer theType,
TCollection_AsciiString &theFormat)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
for (Standard_Integer i = 1; i <= mySeqOfFormats.Length(); i += 3)
if (mySeqOfFormats(i) == theType)
{
const Standard_Integer theNb,
const TCollection_ExtendedString &theStr)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
myMessageBody.Remove ( theFirst, theNb );
myMessageBody.Insert ( theFirst, theStr );
Standard_Boolean Message_MsgFile::LoadFile (const Standard_CString theFileName)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
if (theFileName == NULL || * theFileName == '\0') return Standard_False;
// Open the file
Standard_Boolean Message_MsgFile::LoadFromString (const Standard_CString theContent,
const Standard_Integer theLength)
{
+ Standard_Mutex::Sentry aSentry(theMutex);
Standard_Integer aStringSize = theLength >= 0 ? theLength : (Standard_Integer )strlen (theContent);
NCollection_Buffer aBuffer (NCollection_BaseAllocator::CommonBaseAllocator());
if (aStringSize <= 0 || !aBuffer.Allocate (aStringSize + 2))
const TCollection_ExtendedString& theMessage)
{
Standard_Mutex::Sentry aSentry(theMutex);
- Message_DataMapOfExtendedString& aDataMap = ::msgsDataMap();
-
-
- aDataMap.Bind (theKeyword, theMessage);
+ Message_DataMapOfExtendedString& aDataMap = ::msgsDataMap(); aDataMap.Bind (theKeyword, theMessage);
return Standard_True;
}
Standard_Mutex::Sentry aSentry(theMutex);
// find message in the map
Message_DataMapOfExtendedString& aDataMap = ::msgsDataMap();
-
// if message is not found, generate error message and add it to the map to minimize overhead
// on consequent calls with the same key
Standard_Mutex::Sentry aLock(aPars);
RWHeaderSection::Init();
RWStepAP214::Init(Handle(StepAP214_Protocol)::DownCast(myAdaptorProtocol));
+
+ // initialization of Standard Shape Healing
+ ShapeExtend::Init();
+
+ // init Standard Shape Processing operators
+ ShapeProcess_OperLibrary::Init();
}
Handle(STEPControl_ActorWrite) ActWrite = new STEPControl_ActorWrite;
Handle(IFSelect_EditForm) edsdrf = new IFSelect_EditForm (edsdr,Standard_False,Standard_True,"STEP Product Data (SDR)");
AddSessionItem (edsdr,"step-SDR-edit");
AddSessionItem (edsdrf,"step-SDR-data");
-
- // initialization of Standard Shape Healing
- ShapeExtend::Init();
-
- // init Standard Shape Processing operators
- ShapeProcess_OperLibrary::Init();
}
Handle(Interface_InterfaceModel) STEPControl_Controller::NewModel () const
//pdn S4133 18.02.99
WS->AddNamedItem ("xst-derived",new IFSelect_SignAncestor());
Handle(STEPSelections_SelectDerived) stdvar = new STEPSelections_SelectDerived();
- stdvar->SetProtocol(myAdaptorProtocol);
+
+ static Standard_Mutex aPars;
+ {
+ Standard_Mutex::Sentry aLock(aPars);
+ stdvar->SetProtocol(myAdaptorProtocol);
+ }
WS->AddNamedItem ("step-derived",stdvar);
//Creates a Selection for ShapeDefinitionRepresentation