-- for extraction of a transient handle
-- ====================================
-@verboseoff;
-
@template HandleTransient (%HTName,%HTInherits) is
$// File generated by CPPExt (Transient)
$//
$#ifndef _Handle_%HTName_HeaderFile
$#define _Handle_%HTName_HeaderFile
$
-$#ifndef _Standard_Macro_HeaderFile
-$#include <Standard_Macro.hxx>
-$#endif
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
+$#ifndef _Standard_DefineHandle_HeaderFile
+$#include <Standard_DefineHandle.hxx>
+$#endif
$
$#ifndef _Handle_%HTInherits_HeaderFile
$#include <Handle_%HTInherits.hxx>
$#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;
-- ===============================
@template TransientInstClass (%ClassComment,
- %Class,
+ %Class,
%TICIncludes,
%Inherits,
%TICPublicmets,
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
+$#ifndef _Standard_DefineHandle_HeaderFile
+$#include <Standard_DefineHandle.hxx>
+$#endif
$#ifndef _Handle_%Class_HeaderFile
$#include <Handle_%Class.hxx>
$#endif
$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
$};
$%TICUndefines
$
$// other Inline functions and methods (like "C++: function call" methods)
-$//
$%TICSuppMethod
$
$#endif
$
$#include <%Class.%Suffix>
$
-$#ifndef _Standard_TypeMismatch_HeaderFile
-$#include <Standard_TypeMismatch.hxx>
+$#ifndef _Standard_Type_HeaderFile
+$#include <Standard_Type.hxx>
$#endif
$
$%Supplement
$#ifndef _%Class_HeaderFile
$#define _%Class_HeaderFile
$
-$%TICIncludes
-$
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
$#include <Standard_Macro.hxx>
$#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
$
$protected:
$
-$ // Methods PROTECTED
-$ //
$%TICProtectedmets
$
-$ // Fields PROTECTED
-$ //
$%TICProtectedfields
$
-$private:
+$private:
$
-$ // Methods PRIVATE
-$ //
$%TICPrivatemets
$
-$ // Fields PRIVATE
-$ //
$%TICPrivatefields
$%TICPrivatefriends
$};
$%TICUndefines
$
$// other Inline functions and methods (like "C++: function call" methods)
-$//
$%TICSuppMethod
$
$#endif
$#ifndef _%Class_HeaderFile
$#define _%Class_HeaderFile
$
-$%TICIncludes
-$
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
$#include <Standard_Macro.hxx>
$#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
$};
$%TICUndefines
$
$// other Inline functions and methods (like "C++: function call" methods)
-$//
$%TICSuppMethod
$
$#endif
$#ifndef _Standard_Type_HeaderFile
$#include <Standard_Type.hxx>
$#endif
-$#ifndef _Standard_TypeMismatch_HeaderFile
-$#include <Standard_TypeMismatch.hxx>
-$#endif
$
$%Supplement
$
$#define _%Class_HeaderFile
$
$%EnumComment
-$enum %Class {
-$ %Values
+$enum %Class {
+$%Values
$};
$
-$
$#ifndef _Standard_PrimitiveTypes_HeaderFile
$#include <Standard_PrimitiveTypes.hxx>
$#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;
-- ================
$
$#ifndef _%Class_HeaderFile
$#define _%Class_HeaderFile
+$
$#ifndef _%Inherits_HeaderFile
$#include <%Inherits.hxx>
$#endif
$%HandleTypedef
$
$#define %Class_Type_() %Inherits_Type_()
+$
$#endif
@end;
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
-$#ifndef _Handle_%Class_HeaderFile
-$#include <Handle_%Class.hxx>
+$#ifndef _Standard_DefineHandle_HeaderFile
+$#include <Standard_DefineHandle.hxx>
+$#endif
+$#ifndef _Standard_DefineException_HeaderFile
+$#include <Standard_DefineException.hxx>
$#endif
-$
$#ifndef _Standard_SStream_HeaderFile
$#include <Standard_SStream.hxx>
$#endif
$
-$
$#ifndef _%Inherits_HeaderFile
$#include <%Inherits.hxx>
$#endif
-$
+$#ifndef _Handle_%Class_HeaderFile
+$#include <Handle_%Class.hxx>
+$#endif
$
$#if !defined No_Exception && !defined No_%Class
$#define %Class_Raise_if(CONDITION,MESSAGE) \
$#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 <Standard_Macro.hxx>
-$#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;
-- ==============
-- ==============================================
@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
@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
${
$ %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;
-- ===============
-- 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;
-- =================================
@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 <Standard_Macro.hxx>
$#endif
-$
-$#ifndef _Handle_%HPInherits_HeaderFile
-$#include <Handle_%HPInherits.hxx>
+$#ifndef _Standard_DefineHandle_HeaderFile
+$#include <Standard_DefineHandle.hxx>
$#endif
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
+$#ifndef _Handle_%HPInherits_HeaderFile
+$#include <Handle_%HPInherits.hxx>
+$#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,
$// 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 <Handle_%Class.hxx>
+$#ifndef _Standard_Macro_HeaderFile
+$#include <Standard_Macro.hxx>
+$#endif
+$#ifndef _Standard_DefineHandle_HeaderFile
+$#include <Standard_DefineHandle.hxx>
$#endif
$#ifndef _Standard_HeaderFile
$#include <Standard.hxx>
$#endif
+$#ifndef _Handle_%Class_HeaderFile
+$#include <Handle_%Class.hxx>
+$#endif
$
$%TICIncludes
$
$
$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
$};
$%TICUndefines
$
$// other Inline functions and methods (like "C++: function call" methods)
-$//
$%TICSuppMethod
$
$#endif
$
$#include <%Class.%Suffix>
$
-$#ifndef _Standard_TypeMismatch_HeaderFile
-$#include <Standard_TypeMismatch.hxx>
+$#ifndef _Standard_Type_HeaderFile
+$#include <Standard_Type.hxx>
$#endif
$
$%Supplement