From 064780e4720981dda7983f1e054099803434985b Mon Sep 17 00:00:00 2001 From: cascade Date: Fri, 30 Jan 2009 17:32:05 +0000 Subject: [PATCH] OCC20515 OCC parallelization --- src/CPPExt/CPPExt_Template.edl | 333 +++++++--------------------- src/CPPExt/CPPExt_TemplateCSFDB.edl | 101 ++++----- src/CPPExt/FILES | 3 - 3 files changed, 126 insertions(+), 311 deletions(-) diff --git a/src/CPPExt/CPPExt_Template.edl b/src/CPPExt/CPPExt_Template.edl index e4881d3..74af369 100755 --- a/src/CPPExt/CPPExt_Template.edl +++ b/src/CPPExt/CPPExt_Template.edl @@ -8,8 +8,6 @@ -- for extraction of a transient handle -- ==================================== -@verboseoff; - @template HandleTransient (%HTName,%HTInherits) is $// File generated by CPPExt (Transient) $// @@ -35,55 +33,24 @@ $ $#ifndef _Handle_%HTName_HeaderFile $#define _Handle_%HTName_HeaderFile $ -$#ifndef _Standard_Macro_HeaderFile -$#include -$#endif $#ifndef _Standard_HeaderFile $#include $#endif +$#ifndef _Standard_DefineHandle_HeaderFile +$#include +$#endif $ $#ifndef _Handle_%HTInherits_HeaderFile $#include $#endif $ $class Standard_Transient; -$class Handle_Standard_Type; +$class Handle(Standard_Type); $class Handle(%HTInherits); $class %HTName; -$Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(%HTName); -$ -$class Handle(%HTName) : public Handle(%HTInherits) { -$ public: -$ Handle(%HTName)():Handle(%HTInherits)() {} -$ Handle(%HTName)(const Handle(%HTName)& aHandle) : Handle(%HTInherits)(aHandle) -$ { -$ } -$ -$ Handle(%HTName)(const %HTName* anItem) : Handle(%HTInherits)((%HTInherits *)anItem) -$ { -$ } -$ -$ Handle(%HTName)& operator=(const Handle(%HTName)& aHandle) -$ { -$ Assign(aHandle.Access()); -$ return *this; -$ } -$ -$ Handle(%HTName)& operator=(const %HTName* anItem) -$ { -$ Assign((Standard_Transient *)anItem); -$ return *this; -$ } -$ -$ %HTName* operator->() const -$ { -$ return (%HTName *)ControlAccess(); -$ } -$ -$// Standard_EXPORT ~Handle(%HTName)(); -$ -$ Standard_EXPORT static const Handle(%HTName) DownCast(const Handle(Standard_Transient)& AnObject); -$}; +$ +$DEFINE_STANDARD_HANDLE(%HTName,%HTInherits) +$ $#endif @end; @@ -93,7 +60,7 @@ $#endif -- =============================== @template TransientInstClass (%ClassComment, - %Class, + %Class, %TICIncludes, %Inherits, %TICPublicmets, @@ -135,6 +102,9 @@ $ $#ifndef _Standard_HeaderFile $#include $#endif +$#ifndef _Standard_DefineHandle_HeaderFile +$#include +$#endif $#ifndef _Handle_%Class_HeaderFile $#include $#endif @@ -145,35 +115,20 @@ $%ClassComment $class %Class : public %Inherits { $ $public: -$ // Methods PUBLIC -$ // -$%TICPublicmets $ +$%TICPublicmets $%TICPublicfriends $ -$ // Type management -$ // -$ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; -$ //Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; +$ DEFINE_STANDARD_RTTI(%Class) $ $protected: $ -$ // Methods PROTECTED -$ // $%TICProtectedmets -$ -$ // Fields PROTECTED -$ // $%TICProtectedfields $ $private: $ -$ // Methods PRIVATE -$ // $%TICPrivatemets -$ -$ // Fields PRIVATE -$ // $%TICPrivatefields $%TICPrivatefriends $}; @@ -183,7 +138,6 @@ $%TICInlineIncludes $%TICUndefines $ $// other Inline functions and methods (like "C++: function call" methods) -$// $%TICSuppMethod $ $#endif @@ -213,8 +167,8 @@ $// License. $ $#include <%Class.%Suffix> $ -$#ifndef _Standard_TypeMismatch_HeaderFile -$#include +$#ifndef _Standard_Type_HeaderFile +$#include $#endif $ $%Supplement @@ -267,8 +221,6 @@ $ $#ifndef _%Class_HeaderFile $#define _%Class_HeaderFile $ -$%TICIncludes -$ $#ifndef _Standard_HeaderFile $#include $#endif @@ -276,25 +228,25 @@ $#ifndef _Standard_Macro_HeaderFile $#include $#endif $ +$%TICIncludes +$ $%ClassComment $class %Class %Inherits { -$ $public: $ -$ void* operator new(size_t,void* anAddress) -$ { -$ return anAddress; -$ } -$ void* operator new(size_t size) -$ { -$ return Standard::Allocate(size); -$ } -$ void operator delete(void *anAddress) -$ { -$ if (anAddress) Standard::Free((Standard_Address&)anAddress); -$ } -$ // Methods PUBLIC -$ // +$ void* operator new(size_t,void* anAddress) +$ { +$ return anAddress; +$ } +$ void* operator new(size_t size) +$ { +$ return Standard::Allocate(size); +$ } +$ void operator delete(void *anAddress) +$ { +$ if (anAddress) Standard::Free((Standard_Address&)anAddress); +$ } +$ $%TICPublicmets $ $%TICPublicfriends @@ -302,22 +254,14 @@ $ $ $protected: $ -$ // Methods PROTECTED -$ // $%TICProtectedmets $ -$ // Fields PROTECTED -$ // $%TICProtectedfields $ -$private: +$private: $ -$ // Methods PRIVATE -$ // $%TICPrivatemets $ -$ // Fields PRIVATE -$ // $%TICPrivatefields $%TICPrivatefriends $}; @@ -327,7 +271,6 @@ $%TICInlineIncludes $%TICUndefines $ $// other Inline functions and methods (like "C++: function call" methods) -$// $%TICSuppMethod $ $#endif @@ -405,8 +348,6 @@ $ $#ifndef _%Class_HeaderFile $#define _%Class_HeaderFile $ -$%TICIncludes -$ $#ifndef _Standard_HeaderFile $#include $#endif @@ -414,53 +355,38 @@ $#ifndef _Standard_Macro_HeaderFile $#include $#endif $ -$Standard_EXPORT Handle_Standard_Type& %Class_Type_(); +$%TICIncludes +$ +$Standard_EXPORT const Handle(Standard_Type)& STANDARD_TYPE(%Class); $ $%ClassComment $class %Class %Inherits { $ $public: -$ void* operator new(size_t,void* anAddress) -$ { -$ return anAddress; -$ } -$ void* operator new(size_t size) -$ { -$ return Standard::Allocate(size); -$ } -$ void operator delete(void *anAddress) -$ { -$ if (anAddress) Standard::Free((Standard_Address&)anAddress); -$ } -$ -$ // Methods PUBLIC -$ // -$%TICPublicmets +$ void* operator new(size_t,void* anAddress) +$ { +$ return anAddress; +$ } +$ void* operator new(size_t size) +$ { +$ return Standard::Allocate(size); +$ } +$ void operator delete(void *anAddress) +$ { +$ if (anAddress) Standard::Free((Standard_Address&)anAddress); +$ } $ +$%TICPublicmets $%TICPublicfriends $ -$ // Type management -$ // -$ Standard_EXPORT friend Handle_Standard_Type& %Class_Type_(); -$ $protected: $ -$ // Methods PROTECTED -$ // $%TICProtectedmets -$ -$ // Fields PROTECTED -$ // $%TICProtectedfields $ $private: $ -$ // Methods PRIVATE -$ // $%TICPrivatemets -$ -$ // Fields PRIVATE -$ // $%TICPrivatefields $%TICPrivatefriends $}; @@ -470,7 +396,6 @@ $%TICInlineIncludes $%TICUndefines $ $// other Inline functions and methods (like "C++: function call" methods) -$// $%TICSuppMethod $ $#endif @@ -503,9 +428,6 @@ $ $#ifndef _Standard_Type_HeaderFile $#include $#endif -$#ifndef _Standard_TypeMismatch_HeaderFile -$#include -$#endif $ $%Supplement $ @@ -542,11 +464,10 @@ $#ifndef _%Class_HeaderFile $#define _%Class_HeaderFile $ $%EnumComment -$enum %Class { -$ %Values +$enum %Class { +$%Values $}; $ -$ $#ifndef _Standard_PrimitiveTypes_HeaderFile $#include $#endif @@ -555,26 +476,7 @@ $#endif @end; @template EnumCXX(%Class,%Values,%Nb) is -$// File generated by CPPExt (Enum) -$// -$// Copyright (C) 1991 - 2000 by -$// Matra Datavision SA. All rights reserved. -$// -$// Copyright (C) 2001 - 2004 by -$// Open CASCADE SA. All rights reserved. -$// -$// This file is part of the Open CASCADE Technology software. -$// -$// This software may be distributed and/or modified under the terms and -$// conditions of the Open CASCADE Public License as defined by Open CASCADE SA -$// and appearing in the file LICENSE included in the packaging of this file. -$// -$// This software is distributed on an "AS IS" basis, without warranty of any -$// kind, and Open CASCADE SA hereby disclaims all such warranties, -$// including without limitation, any warranties of merchantability, fitness -$// for a particular purpose or non-infringement. Please see the License for -$// the specific terms and conditions governing rights and limitations under the -$// License. +$ @end; -- ================ @@ -604,6 +506,7 @@ $// License. $ $#ifndef _%Class_HeaderFile $#define _%Class_HeaderFile +$ $#ifndef _%Inherits_HeaderFile $#include <%Inherits.hxx> $#endif @@ -612,6 +515,7 @@ $typedef %Inherits %Class; $%HandleTypedef $ $#define %Class_Type_() %Inherits_Type_() +$ $#endif @end; @@ -682,19 +586,22 @@ $ $#ifndef _Standard_HeaderFile $#include $#endif -$#ifndef _Handle_%Class_HeaderFile -$#include +$#ifndef _Standard_DefineHandle_HeaderFile +$#include +$#endif +$#ifndef _Standard_DefineException_HeaderFile +$#include $#endif -$ $#ifndef _Standard_SStream_HeaderFile $#include $#endif $ -$ $#ifndef _%Inherits_HeaderFile $#include <%Inherits.hxx> $#endif -$ +$#ifndef _Handle_%Class_HeaderFile +$#include +$#endif $ $#if !defined No_Exception && !defined No_%Class $#define %Class_Raise_if(CONDITION,MESSAGE) \ @@ -703,58 +610,13 @@ $#else $#define %Class_Raise_if(CONDITION,MESSAGE) $#endif $ -$class %Class : public %Inherits { -$ -$#ifndef NO_CXX_EXCEPTION -$ Standard_EXPORT virtual void Throw() const; -$#endif -$public: -$ Standard_EXPORT %Class():%Inherits(){} -$ Standard_EXPORT %Class(const Standard_CString AString):%Inherits(AString){} -$ Standard_EXPORT static void Raise(const Standard_CString aMessage = ""); -$ Standard_EXPORT static void Raise(Standard_SStream& aReason); -$ Standard_EXPORT static Handle(%Class) NewInstance(const Standard_CString aMessage); -$ -$// Standard_EXPORT ~%Class(); -$ -$ // Type methods -$ // -$ Standard_EXPORT friend Handle_Standard_Type& %Class_Type_(); -$ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; -$// Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; -$}; +$DEFINE_STANDARD_EXCEPTION(%Class,%Inherits) $ $#endif @end; @template ExceptionMethod(%Class) is -$#ifndef _Standard_Macro_HeaderFile -$#include -$#endif -$//%Class::~%Class(){} -$ -$void %Class::Raise(Standard_SStream& aReason) -${ -$ Handle(%Class) _E(new %Class); -$ _E->Reraise (GetSString(aReason)); -$} -$ -$void %Class::Raise(const Standard_CString AString) -${ -$ Handle(%Class) _E (new %Class); -$ _E->Reraise(AString); -$} -$ -$Handle(%Class) %Class::NewInstance(const Standard_CString aMessage) -${ -$ return new %Class(aMessage); -$} -$#ifndef NO_CXX_EXCEPTION -$void %Class::Throw() const -${ -$ throw *this; -$} -$#endif +$IMPLEMENT_STANDARD_EXCEPTION(%Class) @end; -- ============== @@ -816,11 +678,11 @@ $class %IClass; -- ============================================== @template ConstructorHeader(%Class,%Arguments) is -$%Class(%Arguments)\^ +$ %Class(%Arguments)\^ @end; @template MethodHeader(%Virtual,%RetSpec,%Return,%And,%MethodName,%Arguments,%MetSpec) is -$%Virtual %RetSpec %Return%And %MethodName(%Arguments) %MetSpec\^ +$ %Virtual %RetSpec %Return%And %MethodName(%Arguments) %MetSpec\^ @end; @template ExternalConstructorHeader(%Class,%Arguments) is @@ -832,18 +694,17 @@ $%Virtual %RetSpec %Return%And %Class::%MethodName(%Arguments) %MetSpec\^ @end; @template MethodTemplateDec(%MethodComment,%Method) is -$ -$%MethodComment -$Standard_EXPORT %Method; +$ %MethodComment +$ Standard_EXPORT %Method; @end; @template MethodTemplateDecInlineWNT(%MethodComment,%Method) is -$%MethodComment -$%Method; +$ %MethodComment +$ %Method; @end; @template InlineMethodTemplateDec(%Method) is -$%Method\^ +$ %Method\^ @end; @template MethodTemplateDef(%Method,%MBody) is @@ -851,19 +712,18 @@ $%Method ${ $ %MBody $} -$ @end; @template EmptyDestructorTemplate(%Class) is -$//Standard_EXPORT ~%Class(); +$ @end; @template FullEmptyHandleDestructorTemplate(%Class) is -$//Handle_%Class::~Handle_%Class() {} +$ @end; @template FullEmptyDestructorTemplate(%Class) is -$//%Class::~%Class() {} +$ @end; -- =============== @@ -873,61 +733,32 @@ $//%Class::~%Class() {} -- type management : BEGIN @template TypeMgtAncestorType(%Nb) is -$aType%Nb\^ +$\^ @end; @template TypeMgtAncestor(%Nb,%Ancestors) is -$ static Handle_Standard_Type %Nb = STANDARD_TYPE(%Ancestors); +$ STANDARD_TYPE(%Ancestors), @end; @template TypeMgt(%Class,%Inherits,%Ancestors) is $ -$Standard_EXPORT Handle_Standard_Type& %Class_Type_() -${ -$ -$ %Inherits -$ -$ static Handle_Standard_Transient _Ancestors[]= {%AncestorsNULL}; -$ static Handle_Standard_Type _aType = new Standard_Type("%Class", -$ sizeof(%Class), -$ 1, -$ (Standard_Address)_Ancestors, -$ (Standard_Address)NULL); -$ -$ return _aType; -$} +$IMPLEMENT_STANDARD_TYPE(%Class) +$IMPLEMENT_STANDARD_SUPERTYPE_ARRAY() +$%Inherits +$IMPLEMENT_STANDARD_SUPERTYPE_ARRAY_END() +$IMPLEMENT_STANDARD_TYPE_END(%Class) @end; -- type management : END @template DownCast(%Class,%IClass) is -$// DownCast method -$// allow safe downcasting -$// -$const Handle(%Class) Handle(%Class)::DownCast(const Handle(%IClass)& AnObject) -${ -$ Handle(%Class) _anOtherObject; -$ -$ if (!AnObject.IsNull()) { -$ if (AnObject->IsKind(STANDARD_TYPE(%Class))) { -$ _anOtherObject = Handle(%Class)((Handle(%Class)&)AnObject); -$ } -$ } -$ -$ return _anOtherObject ; -$} +$IMPLEMENT_DOWNCAST(%Class,%IClass) @end; @template DynamicType(%Class) is -$const Handle(Standard_Type)& %Class::DynamicType() const -${ -$ return STANDARD_TYPE(%Class) ; -$} +$IMPLEMENT_STANDARD_RTTI(%Class) @end; @template IsKind(%Class,%IClass) is -$//Standard_Boolean %Class::IsKind(const Handle(Standard_Type)& AType) const -$//{ -$// return (STANDARD_TYPE(%Class) == AType || %IClass::IsKind(AType)); -$//} +$ @end; diff --git a/src/CPPExt/CPPExt_TemplateCSFDB.edl b/src/CPPExt/CPPExt_TemplateCSFDB.edl index 72b8877..1702851 100755 --- a/src/CPPExt/CPPExt_TemplateCSFDB.edl +++ b/src/CPPExt/CPPExt_TemplateCSFDB.edl @@ -8,62 +8,56 @@ -- ================================= @template HandlePersistentCSFDB(%HPName,%HPInherits) is +$// File generated by CPPExt (Persistent CSFDB) +$// +$// +$// Copyright (C) 1991 - 2000 by +$// Matra Datavision SA. All rights reserved. +$// +$// Copyright (C) 2001 - 2004 by +$// Open CASCADE SA. All rights reserved. +$// +$// This file is part of the Open CASCADE Technology software. +$// +$// This software may be distributed and/or modified under the terms and +$// conditions of the Open CASCADE Public License as defined by Open CASCADE SA +$// and appearing in the file LICENSE included in the packaging of this file. +$// +$// This software is distributed on an "AS IS" basis, without warranty of any +$// kind, and Open CASCADE SA hereby disclaims all such warranties, +$// including without limitation, any warranties of merchantability, fitness +$// for a particular purpose or non-infringement. Please see the License for +$// the specific terms and conditions governing rights and limitations under the +$// License. +$ $#ifndef _Handle_%HPName_HeaderFile $#define _Handle_%HPName_HeaderFile $ $#ifndef _Standard_Macro_HeaderFile $#include $#endif -$ -$#ifndef _Handle_%HPInherits_HeaderFile -$#include +$#ifndef _Standard_DefineHandle_HeaderFile +$#include $#endif $#ifndef _Standard_HeaderFile $#include $#endif +$#ifndef _Handle_%HPInherits_HeaderFile +$#include +$#endif $ $class Standard_Persistent; -$class Handle_Standard_Type; +$class Handle(Standard_Type); $class Handle(%HPInherits); $class %HPName; -$Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(%HPName); -$ -$class Handle(%HPName) : public Handle(%HPInherits) { -$ public: -$ -$ Handle(%HPName)():Handle(%HPInherits)() {} -$ Handle(%HPName)(const Handle(%HPName)& aHandle) : Handle(%HPInherits)(aHandle) -$ { -$ } -$ -$ Handle(%HPName)(const %HPName* anItem) : Handle(%HPInherits)((%HPInherits *)anItem) -$ { -$ } -$ -$ Handle(%HPName)& operator=(const Handle(%HPName)& aHandle) -$ { -$ Assign(aHandle.Access()); -$ return *this; -$ } -$ -$ Handle(%HPName)& operator=(const %HPName* anItem) -$ { -$ Assign((Standard_Persistent *)anItem); -$ return *this; -$ } -$ -$ %HPName* operator->() const -$ { -$ return (%HPName *)ControlAccess(); -$ } -$ -$ Standard_EXPORT static const Handle(%HPName) DownCast(const Handle(Standard_Persistent)& AnObject); -$}; +$ +$DEFINE_STANDARD_PHANDLE(%HPName,%HPInherits) +$ $#endif @end; @template PersistentCSFDBInstClass(%Class, - %Inherits, + %Inherits, %TICIncludes, %TICPublicfriends, %TICPublicmets, @@ -98,15 +92,22 @@ $// including without limitation, any warranties of merchantability, fitness $// for a particular purpose or non-infringement. Please see the License for $// the specific terms and conditions governing rights and limitations under the $// License. +$ $#ifndef _%Class_HeaderFile $#define _%Class_HeaderFile $ -$#ifndef _Handle_%Class_HeaderFile -$#include +$#ifndef _Standard_Macro_HeaderFile +$#include +$#endif +$#ifndef _Standard_DefineHandle_HeaderFile +$#include $#endif $#ifndef _Standard_HeaderFile $#include $#endif +$#ifndef _Handle_%Class_HeaderFile +$#include +$#endif $ $%TICIncludes $ @@ -114,32 +115,19 @@ $class %Class : public %Inherits { $ $public: $ -$ // Methods PUBLIC -$ // $%TICPublicmets $%TICPublicfriends $ -$ // Type management -$ // -$ Standard_EXPORT const Handle(Standard_Type)& DynamicType() const; -$// Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const; +$ DEFINE_STANDARD_RTTI(%Class) $ $protected: $ -$ // Methods PROTECTED -$ // $%TICProtectedmets -$ // Fields PROTECTED -$ // $%TICProtectedfields $ $private: $ -$ // Methods PRIVATE -$ // $%TICPrivatemets -$ // Fields PRIVATE -$ // $%TICPrivatefields $%TICPrivatefriends $}; @@ -149,7 +137,6 @@ $%TICInlineIncludes $%TICUndefines $ $// other Inline functions and methods (like "C++: function call" methods) -$// $%TICSuppMethod $ $#endif @@ -179,8 +166,8 @@ $// License. $ $#include <%Class.%Suffix> $ -$#ifndef _Standard_TypeMismatch_HeaderFile -$#include +$#ifndef _Standard_Type_HeaderFile +$#include $#endif $ $%Supplement diff --git a/src/CPPExt/FILES b/src/CPPExt/FILES index 7398f7c..9ad364e 100755 --- a/src/CPPExt/FILES +++ b/src/CPPExt/FILES @@ -10,13 +10,10 @@ CPPExt_MPV.cxx CPPExt_Enum.cxx CPPExt_Alias.cxx CPPExt_Pointer.cxx -CPPExt_TemplateOBJY.edl CPPExt_TemplateCSFDB.edl -CPPExt_TemplateOBJS.edl CPPExt_Template.edl CPPExt.hxx CPPExt_Define.hxx FILES CPPExt_Standard.edl CPPExt_LDSHR.edl - -- 2.39.5