]> OCCT Git - occt-wok.git/commitdiff
0024557: Improve formatting of HXX files generated by WOK
authorkgv <kgv@opencascade.com>
Tue, 18 Mar 2014 07:27:30 +0000 (11:27 +0400)
committerabv <abv@opencascade.com>
Wed, 28 May 2014 05:34:31 +0000 (09:34 +0400)
Remove extra spaces at the beginning of the line.
Apply 2 spaces indentation for method comments.
Add newline after each method declaration.
Do not generate <br> tags; treat single dot as empty line.
Drop occasional backslashes at the of the comment.
Improve class headers templates to meet OCCT coding style.
Remove #ifdefs around #includes in generated HXX.

13 files changed:
src/CDLFront/CDLFront.cxx
src/CPPClient/CPPClient_General.edl
src/CPPClient/CPPClient_Template.edl
src/CPPExt/CPPExt.cxx
src/CPPExt/CPPExt_Define.hxx
src/CPPExt/CPPExt_Package.cxx
src/CPPExt/CPPExt_Standard.edl
src/CPPExt/CPPExt_Storable.cxx
src/CPPExt/CPPExt_Template.edl
src/CPPExt/CPPExt_TemplateCSFDB.edl
src/CPPExt/CPPExt_TemplateOBJS.edl
src/CPPExt/CPPExt_TemplateOBJY.edl
src/CPPExt/CPPExt_Transient.cxx

index 3207d64714f77e79ef4951e71b7b584d1e0205e5..16bb83021251beb3c31b6f5db17c079d11e78bbd 100755 (executable)
@@ -209,6 +209,7 @@ namespace
   static Handle(TColStd_HSequenceOfHAsciiString) TheListOfName      = new TColStd_HSequenceOfHAsciiString();
   static Handle(TColStd_HSequenceOfHAsciiString) TheListOfCplusplus = new TColStd_HSequenceOfHAsciiString();
   static Handle(TColStd_HSequenceOfHAsciiString) TheListOfComments  = new TColStd_HSequenceOfHAsciiString();
+  static Standard_Boolean                        TheIsEmptyLineInComment = Standard_False;
 
   static Handle(TColStd_HSequenceOfInteger)      TheListOfCPPType   = new TColStd_HSequenceOfInteger();
   static Handle(TColStd_HSequenceOfHAsciiString) TheListOfInteger   = new TColStd_HSequenceOfHAsciiString();
@@ -303,6 +304,7 @@ void CDL_InitVariable()
   TheListOfName      = new TColStd_HSequenceOfHAsciiString();
   TheListOfCplusplus = new TColStd_HSequenceOfHAsciiString();
   TheListOfComments  = new TColStd_HSequenceOfHAsciiString();
+  TheIsEmptyLineInComment = Standard_False;
   TheListOfCPPType   = new TColStd_HSequenceOfInteger();
   TheListOfInteger   = new TColStd_HSequenceOfHAsciiString();
   TheListOfGlobalUsed.Nullify();
@@ -369,8 +371,9 @@ void Type_Name(char* aName)
 //function : CheckCommentListIsEmpty
 //purpose  :
 //=======================================================================
-void CheckCommentListIsEmpty (const char* /*theFunctionName*/)
+void CheckCommentListIsEmpty (const char* theFunctionName)
 {
+  (void )theFunctionName;
   if (TheListOfComments->IsEmpty())
   {
     return;
@@ -713,35 +716,83 @@ void Add_Type()
   TheListOfPackages->Append(aPackName);
 }
 
-void add_documentation(char* comment)
+void add_documentation (char* theComment)
 {
-  Handle(TCollection_HAsciiString) aComment;
-  Handle(TCollection_HAsciiString) aRealComment;
-  Standard_Integer pos;
-  aComment = new TCollection_HAsciiString(comment);
-  pos = aComment->Location(1,':',1,aComment->Length());
-  aRealComment = aComment->SubString(pos + 1, aComment->Length());
+  Handle(TCollection_HAsciiString) aComment     = new TCollection_HAsciiString (theComment);
+  Standard_Integer                 aPos         = aComment->Location (1, ':', 1, aComment->Length());
+  Handle(TCollection_HAsciiString) aRealComment = aComment->SubString (aPos + 1, aComment->Length());
   aRealComment->RightAdjust();
-  if (!aRealComment->IsEmpty())
+  aRealComment->LeftAdjust();
+  if (aRealComment->String() == ".")
+  {
+    aRealComment->Clear();
+  }
+  for (; !aRealComment->IsEmpty()
+       && aRealComment->Value (aRealComment->Length()) == '\\'; )
   {
-    aRealComment->AssignCat (" <br>");
-    aRealComment->Insert(1,"//!");
-    TheListOfComments->Append(aRealComment);
+    // should not appear in comments
+    aRealComment->Remove (aRealComment->Length());
   }
+  if (aRealComment->IsEmpty())
+  {
+    TheIsEmptyLineInComment = !TheListOfComments->IsEmpty();
+    return;
+  }
+
+  if (!TheListOfComments->IsEmpty()
+   && TheIsEmptyLineInComment)
+  {
+    TheListOfComments->Append (new TCollection_HAsciiString ("\n//!"));
+  }
+  TheIsEmptyLineInComment = Standard_False;
+  aRealComment->Insert (1, TheListOfComments->IsEmpty() ? "//! " : "\n//! ");
+  TheListOfComments->Append (aRealComment);
 }
 
-void add_documentation1(char* comment)
+void add_documentation1 (char* theComment)
 {
-  while ( *comment && IsSpace(*comment)) comment++;
-  while ( *comment == '-' ) comment++;
-  if ( ! *comment ) return;
+  while (*theComment != '\0'
+       && IsSpace (*theComment))
+  {
+    ++theComment;
+  }
+  while (*theComment == '-')
+  {
+    ++theComment;
+  }
+  if (*theComment == '\0')
+  {
+    return;
+  }
 
-  Handle(TCollection_HAsciiString) aRealComment;
-  aRealComment = new TCollection_HAsciiString(comment);
+  Handle(TCollection_HAsciiString) aRealComment = new TCollection_HAsciiString (theComment);
   aRealComment->RightAdjust();
-  aRealComment->AssignCat (" <br>");
-  aRealComment->Insert(1,"\n//!");
-  TheListOfComments->Append(aRealComment);
+  aRealComment->LeftAdjust();
+  if (aRealComment->String() == ".")
+  {
+    aRealComment->Clear();
+  }
+  for (; !aRealComment->IsEmpty()
+       && aRealComment->Value (aRealComment->Length()) == '\\'; )
+  {
+    // should not appear in comments
+    aRealComment->Remove (aRealComment->Length());
+  }
+  if (aRealComment->IsEmpty())
+  {
+    TheIsEmptyLineInComment = !TheListOfComments->IsEmpty();
+    return;
+  }
+
+  if (!TheListOfComments->IsEmpty()
+   && TheIsEmptyLineInComment)
+  {
+    TheListOfComments->Append (new TCollection_HAsciiString ("\n//!"));
+  }
+  TheIsEmptyLineInComment = Standard_False;
+  aRealComment->Insert (1, "\n//! ");
+  TheListOfComments->Append (aRealComment);
+  TheIsEmptyLineInComment = Standard_False;
 }
 
 //=======================================================================
@@ -2356,20 +2407,21 @@ void add_cpp_comment_to_method()
   }
   else
   {
-    int                               aCommentType;
-    Standard_Integer                  i, aNbCPP;
-    Handle(TCollection_HAsciiString)  aCP;
-
-    for(i = 1; i <= TheListOfComments->Length(); ++i)
+    Standard_Boolean isFirst = Standard_True;
+    for (Standard_Integer aLineIter = 1; aLineIter <= TheListOfComments->Length(); ++aLineIter)
     {
-      TheMethod->SetComment(TheListOfComments->Value(i));
+      Handle(TCollection_HAsciiString) aLine = TheListOfComments->ChangeValue (aLineIter);
+      aLine->Insert (aLine->Value (1) != '\n' ? 1 : 2, isFirst ? "\n  " : "  ");
+      TheMethod->SetComment (aLine);
+      isFirst = Standard_False;
     }
     TheListOfComments->Clear();
 
-    aNbCPP=TheListOfCplusplus->Length();
-    for(i = 1; i <= aNbCPP; ++i)
+    Handle(TCollection_HAsciiString) aCP;
+    const Standard_Integer aNbCPP = TheListOfCplusplus->Length();
+    for(Standard_Integer i = 1; i <= aNbCPP; ++i)
     {
-      aCommentType = TheListOfCPPType->Value(i);
+      Standard_Integer aCommentType = TheListOfCPPType->Value(i);
       //
       switch (aCommentType)
       {
index 57f0015963e794b27bb7219d5e36d6d05e2d5835..3440b614a00f9ffe908eca8e6f9018cf0fd52740 100755 (executable)
 -- ==============
 
 @template Include(%IClass,%Suffix) is
+$#include <%IClass.%Suffix>
+@end;
+
+@template IncludeSafe(%IClass,%Suffix) is
 $#ifndef _%IClass_HeaderFile
 $#include <%IClass.%Suffix>
 $#endif
-@end; 
+@end;
 
 @template IncludeNoSafe(%IClass,%Suffix) is
 $#include <%IClass.%Suffix>
index 9df4fd06943e9094e31347b5b295d33e54b4de10..bda55adf33b1f5f0462358e1d89ec852a9fd2a57 100755 (executable)
@@ -12,12 +12,8 @@ $
 $#ifndef _Handle_%Class_HeaderFile
 $#define _Handle_%Class_HeaderFile
 $
-$#ifndef _Standard_DefineHandle_HeaderFile
 $#include <Standard_DefineHandle.hxx>
-$#endif
-$#ifndef _Handle_%Inherits_HeaderFile
 $#include <Handle_%Inherits.hxx>
-$#endif
 $
 $class Standard_Transient;
 $class Handle(Standard_Type);
@@ -43,12 +39,9 @@ $#define _%Interface_Standard_Transient_HeaderFile
 $
 $#include <Handle_%Interface_Standard_Transient.hxx>
 $
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
+$
 $extern Handle(FrontEnd_EngineAdaptor) __NullEngineAdaptor;
 $extern FrontEnd_FHandle __NullFHandle;
 $Standard_EXPORT Handle_Standard_Type& %Interface_Standard_Transient_Type_();
@@ -81,34 +74,15 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $//
-$#ifndef _%Interface_Standard_Transient_HeaderFile
 $#include <%Interface_Standard_Transient.hxx>
-$#endif
-$
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_InstanceMet_HeaderFile
 $#include <FrontEnd_InstanceMet.hxx>
-$#endif
-$#ifndef _FrontEnd_ClassMet_HeaderFile
 $#include <FrontEnd_ClassMet.hxx>
-$#endif
-$#ifndef _FrontEnd_CreateMet_HeaderFile
 $#include <FrontEnd_CreateMet.hxx>
-$#endif
 $
 $Handle_Standard_Type& %Interface_Standard_Transient_Type_()
 ${
@@ -148,15 +122,9 @@ $#ifndef _%Interface_Standard_Persistent_HeaderFile
 $#define _%Interface_Standard_Persistent_HeaderFile
 $#include <Handle_%Interface_Standard_Persistent.hxx>
 $
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _%Interface_Standard_Storable_HeaderFile
 $#include <%Interface_Standard_Storable.hxx>
-$#endif
 $
 $extern Handle(FrontEnd_EngineAdaptor) __NullEngineAdaptor;
 $extern FrontEnd_FHandle __NullFHandle;
@@ -166,19 +134,20 @@ $class %Interface_Standard_Persistent: public FrontEnd_HExternRef{
 $
 $public:
 $
-$  %Interface_Standard_Persistent(const FrontEnd_FHandle& _aRef, const Handle(FrontEnd_EngineAdaptor)& _anEng) 
-$                                     : FrontEnd_HExternRef(_aRef,_anEng) 
+$  %Interface_Standard_Persistent (const FrontEnd_FHandle& _aRef,
+$                                  const Handle(FrontEnd_EngineAdaptor)& _anEng)
+$  : FrontEnd_HExternRef (_aRef, _anEng)
 $  {
 $  }
 $
-$  const Handle(Standard_Type)& DynamicType() const 
-$  { 
-$   return STANDARD_TYPE(%Interface_Standard_Persistent) ; 
+$  const Handle(Standard_Type)& DynamicType() const
+$  {
+$   return STANDARD_TYPE(%Interface_Standard_Persistent);
 $  }
 $
-$  Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const 
-$  { 
-$   return (STANDARD_TYPE(%Interface_Standard_Persistent) == AType  || FrontEnd_HExternRef::IsKind(AType)); 
+$  Standard_Boolean IsKind(const Handle(Standard_Type)& theType) const
+$  {
+$    return (STANDARD_TYPE(%Interface_Standard_Persistent) == theType || FrontEnd_HExternRef::IsKind (theType));
 $  }
 $};
 $
@@ -192,33 +161,15 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $//
-$#ifndef _%Interface_Standard_Persistent_HeaderFile
 $#include <%Interface_Standard_Persistent.hxx>
-$#endif
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_InstanceMet_HeaderFile
 $#include <FrontEnd_InstanceMet.hxx>
-$#endif
-$#ifndef _FrontEnd_ClassMet_HeaderFile
 $#include <FrontEnd_ClassMet.hxx>
-$#endif
-$#ifndef _FrontEnd_CreateMet_HeaderFile
 $#include <FrontEnd_CreateMet.hxx>
-$#endif
 $
 $Handle_Standard_Type& %Interface_Standard_Persistent_Type_()
 ${
@@ -260,18 +211,11 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $//
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _Standard_Integer_HeaderFile
 $#include <Standard_Integer.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
+$
 $#ifndef _%Interface_Standard_Storable_HeaderFile
 $#define _%Interface_Standard_Storable_HeaderFile
 $Standard_EXPORT Handle_Standard_Type& %Interface_Standard_Storable_Type_();
@@ -301,33 +245,15 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $//
-$#ifndef _%Interface_Standard_Storable_HeaderFile
 $#include <%Interface_Standard_Storable.hxx>
-$#endif
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_InstanceMet_HeaderFile
 $#include <FrontEnd_InstanceMet.hxx>
-$#endif
-$#ifndef _FrontEnd_ClassMet_HeaderFile
 $#include <FrontEnd_ClassMet.hxx>
-$#endif
-$#ifndef _FrontEnd_CreateMet_HeaderFile
 $#include <FrontEnd_CreateMet.hxx>
-$#endif
 $
 $Handle_Standard_Type& %Interface_Standard_Storable_Type_()
 ${
@@ -380,91 +306,61 @@ $#ifndef _%Interface_MMgt_TShared_HeaderFile
 $#define _%Interface_MMgt_TShared_HeaderFile
 $#include <Handle_%Interface_MMgt_TShared.hxx>
 $
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$
-$#ifndef _%Interface_Standard_Transient_HeaderFile
 $#include <%Interface_Standard_Transient.hxx>
-$#endif
 $
 $extern Handle(FrontEnd_EngineAdaptor) __NullEngineAdaptor;
 $extern FrontEnd_FHandle __NullFHandle;
 $class Handle_Standard_Type;
 $Standard_EXPORT Handle_Standard_Type& %Interface_MMgt_TShared_Type_();
 $
-$#ifndef _%Interface_Standard_Transient_HeaderFile
 $#include <%Interface_Standard_Transient.hxx>
-$#endif
-$#ifndef _Standard_Address_HeaderFile
 $#include <Standard_Address.hxx>
-$#endif
-$#ifndef _Standard_Integer_HeaderFile
 $#include <Standard_Integer.hxx>
-$#endif
 $
 $Standard_EXPORT Handle_Standard_Type& %Interface_MMgt_TShared_Type_();
 $
-$class %Interface_MMgt_TShared: public %Interface_Standard_Transient {
+$class %Interface_MMgt_TShared : public %Interface_Standard_Transient
+${
 $
 $public:
-$ %Interface_MMgt_TShared(const FrontEnd_FHandle& _aRef, const Handle(FrontEnd_EngineAdaptor)& _anEng) 
-$                                   : %Interface_Standard_Transient(_aRef,_anEng) 
-$        {
-$        }
+$  %Interface_MMgt_TShared (const FrontEnd_FHandle& _aRef, const Handle(FrontEnd_EngineAdaptor)& _anEng)
+$  : %Interface_Standard_Transient (_aRef, _anEng)
+$  {
+$  }
 $
-$  const Handle(Standard_Type)& DynamicType() const 
-$  { 
-$   return STANDARD_TYPE(%Interface_MMgt_TShared) ; 
+$  const Handle(Standard_Type)& DynamicType() const
+$  {
+$    return STANDARD_TYPE(%Interface_MMgt_TShared);
 $  }
 $
-$  Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const 
-$  { 
-$   return (STANDARD_TYPE(%Interface_MMgt_TShared) == AType  || %Interface_Standard_Transient::IsKind(AType)); 
+$  Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const
+$  {
+$    return (STANDARD_TYPE(%Interface_MMgt_TShared) == AType  || %Interface_Standard_Transient::IsKind(AType));
 $  }
+$
 $};
 $
-$#endif
+$#endif // _%Interface_MMgt_TShared_HeaderFile
 @end;
 
 @template MemoryRootClientCXX(%Interface) is
 $
-$#ifndef _%Interface_MMgt_TShared_HeaderFile
 $#include <%Interface_MMgt_TShared.hxx>
-$#endif
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_InstanceMet_HeaderFile
 $#include <FrontEnd_InstanceMet.hxx>
-$#endif
-$#ifndef _FrontEnd_ClassMet_HeaderFile
 $#include <FrontEnd_ClassMet.hxx>
-$#endif
-$#ifndef _FrontEnd_CreateMet_HeaderFile
 $#include <FrontEnd_CreateMet.hxx>
-$#endif
-$
-$
 $
 $Handle_Standard_Type& %Interface_MMgt_TShared_Type_()
 ${
-$    static Handle_Standard_Type aType1 = STANDARD_TYPE(%Interface_Standard_Transient);
+$  static Handle_Standard_Type aType1 = STANDARD_TYPE(%Interface_Standard_Transient);
 $  static Handle_Standard_Type aType2 = STANDARD_TYPE(FrontEnd_HExternRef);
-$  if ( aType1.IsNull()) aType1 = STANDARD_TYPE(%Interface_Standard_Transient);
-$ 
+$  if (aType1.IsNull()) aType1 = STANDARD_TYPE(%Interface_Standard_Transient);
 $
 $  static Handle_Standard_Transient _Ancestors[]= {aType1,aType2,NULL};
 $  static Handle_Standard_Type _aType = new Standard_Type("%Interface_MMgt_TShared",
@@ -476,17 +372,15 @@ $
 $  return _aType;
 $}
 $
-$
-$const Handle(%Interface_MMgt_TShared) Handle(%Interface_MMgt_TShared)::DownCast(const Handle(Standard_Transient)& AnObject) 
+$const Handle(%Interface_MMgt_TShared) Handle(%Interface_MMgt_TShared)::DownCast(const Handle(Standard_Transient)& theObject)
 ${
-$  Handle(%Interface_MMgt_TShared) _anOtherObject;
-$
-$  if (!AnObject.IsNull()) 
-$    if (AnObject->IsKind(STANDARD_TYPE(%Interface_MMgt_TShared))) {
-$      _anOtherObject = Handle(%Interface_MMgt_TShared)((Handle(%Interface_MMgt_TShared)&)AnObject);
-$    }
-$
-$  return _anOtherObject;
+$  Handle(%Interface_MMgt_TShared) anOtherObject;
+$  if (!theObject.IsNull()
+$   && theObject->IsKind(STANDARD_TYPE(%Interface_MMgt_TShared)))
+$  {
+$    anOtherObject = Handle(%Interface_MMgt_TShared)((Handle(%Interface_MMgt_TShared)&)theObject);
+$  }
+$  return anOtherObject;
 $}
 $
 $Handle(%Interface_MMgt_TShared)::~Handle(%Interface_MMgt_TShared)(){}
@@ -502,15 +396,9 @@ $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $#include <Handle_%Class.hxx>
 $
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_MID_HeaderFile
 $#include <FrontEnd_MID.hxx>
-$#endif
-$#ifndef _%Inherits_HeaderFile
 $#include <%Inherits.hxx>
-$#endif
 $
 $class Handle_Standard_Type;
 $Standard_EXPORT Handle_Standard_Type& %Class_Type_();
@@ -519,28 +407,30 @@ $extern FrontEnd_FHandle __NullFHandle;
 $
 $%Includes
 $
-$class %Class: public %Inherits {
+$class %Class : public %Inherits
+${
 $
 $public:
 $ %Methods
 $
-$ %Class(const FrontEnd_FHandle& _aRef, const Handle(FrontEnd_EngineAdaptor)& _anEng) 
-$                                   : %Inherits(_aRef,_anEng) 
-$        {
-$        }
+$  %Class (const FrontEnd_FHandle& theRef,
+$          const Handle(FrontEnd_EngineAdaptor)& theEng)
+$  : %Inherits (theRef, theEng)
+$  {
+$  }
 $
-$ const Handle(Standard_Type)& DynamicType() const 
-$ 
-$   return STANDARD_TYPE(%Class); 
-$ }
+$  const Handle(Standard_Type)& DynamicType() const
+$  {
+$    return STANDARD_TYPE(%Class);
+$  }
 $
-$ Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const 
-$ {  
-$  return (STANDARD_TYPE(%Class) == AType || %Inherits::IsKind(AType)); 
-$ }
+$  Standard_Boolean IsKind (const Handle(Standard_Type)& theType) const
+$  {
+$    return (STANDARD_TYPE(%Class) == theType || %Inherits::IsKind (theType));
+$  }
 $};
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template RefClassClientCXX(%Class,%Inherits,%Methods,%Includes,%TypeMgt) is
@@ -549,47 +439,28 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $
-$#ifndef _%Class_HeaderFile
 $#include <%Class.hxx>
-$#endif
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_InstanceMet_HeaderFile
 $#include <FrontEnd_InstanceMet.hxx>
-$#endif
-$#ifndef _FrontEnd_ClassMet_HeaderFile
 $#include <FrontEnd_ClassMet.hxx>
-$#endif
-$#ifndef _FrontEnd_CreateMet_HeaderFile
 $#include <FrontEnd_CreateMet.hxx>
-$#endif
 $
 $%Includes
 $
 $%TypeMgt
 $
-$const Handle(%Class) Handle(%Class)::DownCast(const Handle(Standard_Transient)& AnObject) 
+$const Handle(%Class) Handle(%Class)::DownCast (const Handle(Standard_Transient)& theObject)
 ${
-$  Handle(%Class) _anOtherObject;
-$
-$  if (!AnObject.IsNull()) 
-$    if (AnObject->IsKind(STANDARD_TYPE(%Class))) {
-$      _anOtherObject = Handle(%Class)((Handle(%Class)&)AnObject);
-$    }
-$
+$  Handle(%Class) anOtherObject;
+$  if (!theObject.IsNull()
+$   && theObject->IsKind(STANDARD_TYPE(%Class)))
+$  {
+$    anOtherObject = Handle(%Class)((Handle(%Class)&)theObject);
+$  }
 $  return _anOtherObject;
 $}
 $
@@ -607,32 +478,30 @@ $
 $//
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
+$
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _%Inherits_HeaderFile
 $#include <%Inherits.hxx>
-$#endif
-$#ifndef _FrontEnd_MID_HeaderFile
 $#include <FrontEnd_MID.hxx>
-$#endif
+$
 $extern Handle(FrontEnd_EngineAdaptor) __NullEngineAdaptor;
 $extern FrontEnd_FHandle __NullFHandle;
 $%Includes
 $
-$class %Class: public %Inherits {
+$class %Class : public %Inherits
+${
 $
 $public:
-$ %Methods
+$  %Methods
 $
-$ %Class(const FrontEnd_FHandle&) %InheritsTrick {}
-$ %Class(const FrontEnd_FHandle& _aRef, const Handle(FrontEnd_EngineAdaptor)& _anEng) 
-$                                   : %Inherits(_aRef,_anEng) 
-$        {
-$        }
+$  %Class (const FrontEnd_FHandle&) %InheritsTrick {}
+$  %Class (const FrontEnd_FHandle& theRef,
+$          const Handle(FrontEnd_EngineAdaptor)& theEng)
+$  : %Inherits (theRef, theEng)
+$  {
+$  }
 $};
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template ValueClassClientCXX(%Class,%Methods,%Includes) is
@@ -641,33 +510,15 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $
-$#ifndef _%Class_HeaderFile
 $#include <%Class.hxx>
-$#endif
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_InstanceMet_HeaderFile
 $#include <FrontEnd_InstanceMet.hxx>
-$#endif
-$#ifndef _FrontEnd_ClassMet_HeaderFile
 $#include <FrontEnd_ClassMet.hxx>
-$#endif
-$#ifndef _FrontEnd_CreateMet_HeaderFile
 $#include <FrontEnd_CreateMet.hxx>
-$#endif
 $
 $%Includes
 $
@@ -682,22 +533,20 @@ $// this header file considered to be the "object code" form of the original sou
 $//
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
+$
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_MID_HeaderFile
 $#include <FrontEnd_MID.hxx>
-$#endif
+$
 $extern Handle(FrontEnd_EngineAdaptor) __NullEngineAdaptor;
 $%Includes
 $
-$class %Class {
-$
+$class %Class
+${
 $public:
-$ %Methods
+$  %Methods
 $};
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template PackageClientCXX(%Class,%Methods,%Includes) is
@@ -706,27 +555,13 @@ $// Please do not edit this file; modify original file instead.
 $// The copyright and license terms as defined for the original file apply to 
 $// this header file considered to be the "object code" form of the original source.
 $
-$#ifndef _%Class_HeaderFile
 $#include <%Class.hxx>
-$#endif
-$#ifndef _FrontEnd_EngineAdaptor_HeaderFile
 $#include <FrontEnd_EngineAdaptor.hxx>
-$#endif
-$#ifndef _FrontEnd_ExternRef_HeaderFile
 $#include <FrontEnd_ExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_HExternRef_HeaderFile
 $#include <FrontEnd_HExternRef.hxx>
-$#endif
-$#ifndef _FrontEnd_FHandle_HeaderFile
 $#include <FrontEnd_FHandle.hxx>
-$#endif
-$#ifndef _FrontEnd_Method_HeaderFile
 $#include <FrontEnd_Method.hxx>
-$#endif
-$#ifndef _FrontEnd_PackageMet_HeaderFile
 $#include <FrontEnd_PackageMet.hxx>
-$#endif
 $
 $%Includes
 $
@@ -742,16 +577,14 @@ $//
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$enum %Class { 
-$ %Values
+$enum %Class
+${
+$  %Values
 $};
 $
-$
-$#ifndef _Standard_PrimitiveTypes_HeaderFile
 $#include <Standard_PrimitiveTypes.hxx>
-$#endif
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 -- method header
@@ -914,10 +747,10 @@ $  if ( %Nb.IsNull()) %Nb = STANDARD_TYPE(%Ancestors);
 $Handle_Standard_Type& %TMgtClass_Type_()
 ${
 $  %TMgtInherits 
-$  static Handle_Standard_Type aTypeT = STANDARD_TYPE(Standard_Transient);
+$  static Handle_Standard_Type aTypeT  = STANDARD_TYPE(Standard_Transient);
 $  static Handle_Standard_Type aTypeTs = STANDARD_TYPE(MMgt_TShared);
-$  static Handle_Standard_Type aTypeR = STANDARD_TYPE(FrontEnd_HExternRef);
-$  static Handle_Standard_Transient _Ancestors[]= {%Ancestors aTypeR,aTypeTs,aTypeT,NULL};
+$  static Handle_Standard_Type aTypeR  = STANDARD_TYPE(FrontEnd_HExternRef);
+$  static Handle_Standard_Transient _Ancestors[]= {%Ancestors aTypeR, aTypeTs, aTypeT, NULL};
 $  static Handle_Standard_Type _aType = new Standard_Type("%TMgtClass",
 $                                                       sizeof(%TMgtClass),
 $                                                       1,
index d1819404039dc7af4b18b83458e9ca988d1435a7..9babe310498121f36ac13fa20134f3b1feffe1e0 100755 (executable)
@@ -1046,3 +1046,13 @@ void CPP_Extract(const Handle(MS_MetaSchema)& aMeta,
   }
 }
                 
+Handle(TCollection_HAsciiString) CPP_WithoutHandleSuffix (const Handle(TCollection_HAsciiString)& theName)
+{
+  const Standard_Integer aSuffLen = Standard_Integer(sizeof("Handle_") - 1);
+  if (theName->Length() > aSuffLen
+   && theName->SubString (1, aSuffLen)->String() == "Handle_")
+  {
+    return theName->SubString (aSuffLen + 1, theName->Length());
+  }
+  return theName;
+}
index 17c8d6a405b81983aa9f0ddebebfbd38767b7023..b91c2c8c1858bb8f4f0bc783cefa9a6edbaa560d 100755 (executable)
@@ -100,4 +100,7 @@ void CPP_ClassTypeMgt(const Handle(MS_MetaSchema)& aMeta,
                      const Handle(MS_Class)& aClass,
                      const Standard_CString var);
 
+//! Auxiliary function to remove Handle_ suffix
+Handle(TCollection_HAsciiString) CPP_WithoutHandleSuffix (const Handle(TCollection_HAsciiString)& theName);
+
 #endif
index 5c78f76293cb9c9bfa152d5d24d9615ffd9ed02c..f0305d57a0d57fdb30ce3b2df49949323af5251d 100755 (executable)
@@ -62,7 +62,8 @@ void CPP_PackageDerivated(const Handle(MS_MetaSchema)& ,
   api->AddVariable(VSuffix,"hxx");
   
   for (i = 1; i <= inclist->Length(); i++) {
-    api->AddVariable(VIClass,inclist->Value(i)->ToCString());
+    Handle(TCollection_HAsciiString) aName = CPP_WithoutHandleSuffix (inclist->Value (i));
+    api->AddVariable (VIClass, aName->ToCString());
     api->Apply(VoutClass,"Include");
     result->AssignCat(api->GetVariableValue(VoutClass));
   }
index e1e90e24942ab04fc7497aecb19da1444027df29..ef916e13e9ebdf3a29f7a7ca6cd29265cfb8d4f7 100755 (executable)
 $#ifndef _Handle_Standard_Transient_HeaderFile
 $#define _Handle_Standard_Transient_HeaderFile
 $
-$#ifndef _Standard_Macro_HeaderFile
 $#include <Standard_Macro.hxx>
-$#endif
-$#ifndef _Standard_PrimitiveTypes_HeaderFile
 $#include <Standard_PrimitiveTypes.hxx>
-$#endif
-$#ifndef _Standard_Transient_proto_HeaderFile
 $#include <Standard_Transient_proto.hxx>
-$#endif
 $
 $class Standard_Transient;
 $class Handle_Standard_Type;
 $
-$Standard_Integer HashCode(const Handle(Standard_Transient)& ,const Standard_Integer);
+$Standard_Integer HashCode(const Handle(Standard_Transient)& , const Standard_Integer );
 $
 $class Handle(Standard_Transient)
-$ {
-$   private:
-$
-$    Standard_Transient *entity;
-$
-$    void RaiseNullObject(const Standard_CString S) const;
-$
-$    void BeginScope() const
-$      {
-$       if (entity != 0) entity->count++;
-$      }    
-$
-$    void EndScope()
-$      {
-$       if (entity != 0)
-$         {
-$          entity->count--;
-$          if (entity->count == 0) {
-$          entity->Delete();
-$          entity = 0;
-$        }
-$      }
-$      }
-$
-$
-$   public:
-$
-$    Handle(Standard_Transient)()
-$      {
-$       entity = 0;
-$      }
-$
-$    Handle(Standard_Transient)(const Handle(Standard_Transient)& aTid) 
-$      {
-$       entity = aTid.entity;
-$       BeginScope();
-$      } 
-$
-$    Handle(Standard_Transient)(const Standard_Transient *anItem)
-$      {
-$       if (!anItem)
-$           entity = 0;
-$       else
-$           entity = (Standard_Transient *)anItem;
-$       BeginScope();
-$      }
-$     void Dump(Standard_OStream& out) const;
-$    ~Handle(Standard_Transient)();
-$
-$     void  ShallowDump(Standard_OStream&) const;
-$     
-$    int operator==(const Handle(Standard_Transient)& right) const
-$      {
-$       return entity == right.entity;
-$      }
-$
-$    int operator==(const Standard_Transient *right) const
-$      {
-$       return entity == (Standard_Transient *)right;
-$      }
-$
-$    friend int operator==(const Standard_Transient *left, const Handle(Standard_Transient)& right)
-$      {
-$       return left == right.entity;
-$      }
-$
-$    int operator!=(const Handle(Standard_Transient)& right) const
-$      {
-$       return entity != right.entity;
-$      }
-$
-$    int operator!=(const Standard_Transient *right) const
-$      {
-$       return entity != right;
-$      }
-$
-$    friend int operator!=(const Standard_Transient *left, const Handle(Standard_Transient)& right)
-$      {
-$       return left != right.entity;
-$      }
-$
-$    void Nullify()
-$      {
-$       EndScope();
-$       entity = 0;
-$      }
+${
+$private:
 $
-$    Standard_Boolean IsNull() const
-$      {
-$       return entity == 0;
-$      } 
+$  Standard_Transient* entity;
 $
-$   protected:
+$  void RaiseNullObject (const Standard_CString S) const;
 $
-$    Standard_Transient* Access() const
-$      {
-$       return entity;
-$      } 
-$
-$    Standard_Transient* ControlAccess() const
-$      {
-$       return entity;
-$      } 
+$  void BeginScope() const
+$  {
+$    if (entity != 0) entity->count++;
+$  }
 $
-$    void Assign(const Standard_Transient *anItem)
+$  void EndScope()
+$  {
+$    if (entity != 0)
+$    {
+$      entity->count--;
+$      if (entity->count == 0)
 $      {
-$       EndScope();
-$       if (!anItem)
-$           entity = 0;
-$       else
-$           entity = (Standard_Transient *)anItem;
-$       entity = (Standard_Transient *)anItem;
-$       BeginScope();
-$      }
-$
-$
-$  public:
-$
-$   operator Standard_Transient*()
-$     {
-$       return Access();
-$     }
-$
+$             entity->Delete();
+$             entity = 0;
+$           }
+$         }
+$  }
+$
+$public:
+$
+$  Handle(Standard_Transient)()
+$  {
+$    entity = 0;
+$  }
+$
+$  Handle(Standard_Transient)(const Handle(Standard_Transient)& theTid)
+$  {
+$    entity = theTid.entity;
+$    BeginScope();
+$  }
+$
+$  Handle(Standard_Transient)(const Standard_Transient* theItem)
+$  {
+$    if (!theItem)
+$      entity = 0;
+$    else
+$      entity = (Standard_Transient* )theItem;
+$    BeginScope();
+$  }
+$
+$  void Dump (Standard_OStream& out) const;
+$  ~Handle(Standard_Transient)();
+$
+$  void ShallowDump (Standard_OStream&) const;
+$
+$  bool operator== (const Handle(Standard_Transient)& theRight) const
+$  {
+$    return entity == theRight.entity;
+$  }
+$
+$  bool operator== (const Standard_Transient* theRight) const
+$  {
+$    return entity == (Standard_Transient* )theRight;
+$  }
+$
+$  friend bool operator== (const Standard_Transient*         theLeft,
+$                          const Handle(Standard_Transient)& theRight)
+$  {
+$    return theLeft == theRight.entity;
+$  }
+$
+$  bool operator!= (const Handle(Standard_Transient)& theRight) const
+$  {
+$    return entity != theRight.entity;
+$  }
+$
+$  bool operator!= (const Standard_Transient* theRight) const
+$  {
+$    return entity != theRight;
+$  }
+$
+$  friend bool operator!= (const Standard_Transient*         theLeft,
+$                          const Handle(Standard_Transient)& theRight)
+$  {
+$    return theLeft != theRight.entity;
+$  }
+$
+$  void Nullify()
+$  {
+$    EndScope();
+$    entity = 0;
+$  }
+$
+$  Standard_Boolean IsNull() const
+$  {
+$    return entity == 0;
+$  }
+$
+$protected:
+$
+$  Standard_Transient* Access() const
+$  {
+$    return entity;
+$  }
+$
+$  Standard_Transient* ControlAccess() const
+$  {
+$    return entity;
+$  }
+$
+$  void Assign (const Standard_Transient* theItem)
+$  {
+$    EndScope();
+$    entity = (Standard_Transient* )theItem;
+$    BeginScope();
+$  }
+$
+$public:
+$
+$  operator Standard_Transient*()
+$  {
+$    return Access();
+$  }
+$
+$  Handle(Standard_Transient)& operator= (const Handle(Standard_Transient)& theHandle);
+$  Handle(Standard_Transient)& operator= (const Standard_Transient* theItem);
+$
+$  Standard_Transient* operator->()
+$  {
+$    return ControlAccess();
+$  }
+$
+$  Standard_Transient* operator->() const
+$  {
+$    return ControlAccess();
+$  }
+$
+$  Standard_Transient& operator*()
+$  {
+$    return *(ControlAccess());
+$  }
+$
+$  const Standard_Transient& operator*() const
+$  {
+$    return *(ControlAccess());
+$  }
+$
+$  static const Handle(Standard_Transient) DownCast (const Handle(Standard_Transient)& theObject);
+$
+$  friend void ShallowDump (const Handle_Standard_Transient&, Standard_OStream&);
 $
-$   Handle(Standard_Transient)& operator=(const Handle(Standard_Transient)& aHandle);
-$   Handle(Standard_Transient)& operator=(const Standard_Transient* anItem);
-$
-$   Standard_Transient* operator->() 
-$     {
-$      return ControlAccess();
-$     }
-$
-$   Standard_Transient* operator->() const
-$     {
-$      return ControlAccess();
-$     }
-$
-$   Standard_Transient& operator*()
-$     {
-$      return *(ControlAccess());
-$     }
-$
-$   const Standard_Transient& operator*() const
-$     {
-$      return *(ControlAccess());
-$     }
-$
-$   static const Handle(Standard_Transient) DownCast(const Handle(Standard_Transient)& AnObject);
-$
-$   friend void ShallowDump(const Handle_Standard_Transient&,Standard_OStream&);
-$
-$ };
+$};
 $
-$#ifndef _Standard_Type_HeaderFile
 $#include <Standard_Type.hxx>
-$#endif
 $
 $#endif
 @end;
@@ -187,68 +176,54 @@ $#endif
 $#ifndef _Standard_Transient_HeaderFile
 $#define _Standard_Transient_HeaderFile
 $
-$#ifndef _Handle_Standard_Transient_HeaderFile
 $#include <Handle_Standard_Transient.hxx>
-$#endif
-$#ifndef _Standard_PrimitiveTypes_HeaderFile
 $#include <Standard_PrimitiveTypes.hxx>
-$#endif
-$#ifndef _Standard_Transient_proto_HeaderFile
 $#include <Standard_Transient_proto.hxx>
-$#endif
-$#ifndef _Standard_Type_HeaderFile
 $#include <Standard_Type.hxx>
-$#endif
 $
-$#endif 
+$#endif
 @end;
 
 @template StandardErrorHandler is
-$//============================================================================
-$//==== Titre: Standard_ErrorHandler.hxx
-$//==== Role : the header file of class "Standard_ErrorHandler".
-$//====        define the syntaxe "try" and "catch". 
-$//============================================================================
+$#ifndef _Standard_ErrorHandler_HeaderFile
+$#define _Standard_ErrorHandler_HeaderFile
 $
-$#ifndef         _Standard_ErrorHandler_HeaderFile
-$#define   _Standard_ErrorHandler_HeaderFile
-$
-$#ifndef _Standard_Failure_HeaderFile
 $#include <Standard_Failure.hxx>
-$#endif
 $
 $#include <stdlib.h>
 $#include <setjmp.h>
 $
-$class Standard_ErrorHandler 
+$//! Define the syntaxe "try" and "catch".
+$class Standard_ErrorHandler
 ${
-$ friend class  Standard_Failure;     // To execute the raise exception.
+$  friend class Standard_Failure; // To execute the raise exception
 $
-$ public:
-$  
-$                                 Standard_ErrorHandler();
-$                                ~Standard_ErrorHandler();
-$           Standard_Boolean      Catches (const Handle(Standard_Type)&);
+$public:
 $
-$ private:
-$  static  void                      Abort();
-$  static  void                      Error(const Handle(Standard_Failure)&);
-$  static  Handle(Standard_Failure)  LastCaughtError();
+$  Standard_ErrorHandler();
+$  ~Standard_ErrorHandler();
+$  Standard_Boolean Catches (const Handle(Standard_Type)& );
 $
-$ //==== The fields ===========================================================
-$ private:
-$           Standard_ErrorHandler*   Previous;
-$           Handle(Standard_Failure) CaughtError;
+$private:
 $
-$ public:
-$           jmp_buf      Label;
+$  static void                     Abort();
+$  static void                     Error (const Handle(Standard_Failure)& );
+$  static Handle(Standard_Failure) LastCaughtError();
 $
-$};
+$private:
+$
+$  Standard_ErrorHandler*   Previous;
+$  Handle(Standard_Failure) CaughtError;
+$
+$public:
 $
+$  jmp_buf Label;
+$
+$};
 $
 $#include <Standard_ErrorHandler.lxx>
 $
-$#endif 
+$#endif // _Standard_ErrorHandler_HeaderFile
 @end;
 
 @template StandardSStream is 
@@ -258,18 +233,19 @@ $
 $#include <strstream.h>
 $
 $class Handle_Standard_Type;
-$
 $Handle_Standard_Type& Standard_SStream_Type_();
 $
-$class Standard_SStream : public strstreambase, public ostream {
+$class Standard_SStream : public strstreambase, public ostream
+${
 $
-$  public:
-$    Standard_SStream();
-$    Standard_SStream(ostream& );
+$public:
+$  Standard_SStream();
+$  Standard_SStream(ostream& );
 $
-$    ~Standard_SStream();
+$  ~Standard_SStream();
 $};
-$#endif
+$
+$#endif // _Standard_SStream_HeaderFile
 @end;
 
 @template StandardIStream is
@@ -278,14 +254,11 @@ $#define _Standard_IStream_HeaderFile
 $
 $#include <stream.h>
 $
-$
 $class Handle_Standard_Type;
-$
 $Handle_Standard_Type& Standard_IStream_Type_();
-$
 $#define Standard_IStream istream
 $
-$#endif
+$#endif // _Standard_IStream_HeaderFile
 @end;
 
 @template StandardOStream is
@@ -294,14 +267,11 @@ $#define _Standard_OStream_HeaderFile
 $
 $#include <stream.h>
 $
-$
 $class Handle_Standard_Type;
-$
 $Handle_Standard_Type& Standard_OStream_Type_();
-$
 $#define Standard_OStream ostream
 $
-$#endif
+$#endif // _Standard_OStream_HeaderFile
 @end;
 
 @template HandleStandardPersistent is
@@ -314,7 +284,8 @@ $//============================================================================
 $
 $#ifndef _Handle_Standard_Persistent_HeaderFile
 $#define _Handle_Standard_Persistent_HeaderFile
+$
 $#include <Handle_StandardDB_Persistent.hxx>
 $
-$#endif
+$#endif // _Handle_Standard_Persistent_HeaderFile
 @end;
index 5c4ae623be71f626c775059cd40a75ea205f35d6..29a524c35aa9d49c8b4d496567c3ce19ab7aa7eb 100755 (executable)
@@ -183,7 +183,8 @@ void CPP_StorableDerivated(const Handle(MS_MetaSchema)& aMeta,
   api->AddVariable(VSuffix,"hxx");
   
   for (i = 1; i <= inclist->Length(); i++) {
-    api->AddVariable(VIClass,inclist->Value(i)->ToCString());
+    Handle(TCollection_HAsciiString) aName = CPP_WithoutHandleSuffix (inclist->Value (i));
+    api->AddVariable (VIClass, aName->ToCString());
     api->Apply(VoutClass,"Include");
     result->AssignCat(api->GetVariableValue(VoutClass));
   }
index 0e307ed88ccd0176026ddea158d9b16dad53fa44..d25e974a21f12f42829483aa32c782eb12627b81 100755 (executable)
@@ -17,28 +17,20 @@ $
 $#ifndef _Handle_%HTName_HeaderFile
 $#define _Handle_%HTName_HeaderFile
 $
-$#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(%HTInherits);
 $class %HTName;
 $
-$DEFINE_STANDARD_HANDLE(%HTName,%HTInherits)
+$DEFINE_STANDARD_HANDLE(%HTName, %HTInherits)
 $
-$#endif
+$#endif // _Handle_%HTName_HeaderFile
 @end;
 
-
 -- ===============================
 -- extraction of a transient class
 -- ===============================
@@ -66,20 +58,15 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#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
 $
 $%TICIncludes
 $
 $%ClassComment
-$class %Class : public %Inherits {
+$class %Class : public %Inherits
+${
 $
 $public:
 $
@@ -104,10 +91,9 @@ $%TICDefines
 $%TICInlineIncludes
 $%TICUndefines
 $
-$// other Inline functions and methods (like "C++: function call" methods)
 $%TICSuppMethod
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template TransientIxx (%Class,%Suffix,%Supplement,%TypeMgt,%Methods) is
@@ -118,9 +104,7 @@ $// this header file considered to be the "object code" form of the original sou
 $
 $#include <%Class.%Suffix>
 $
-$#ifndef _Standard_Type_HeaderFile
 $#include <Standard_Type.hxx>
-$#endif
 $
 $%Supplement 
 $
@@ -156,20 +140,15 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#ifndef _Standard_HeaderFile
 $#include <Standard.hxx>
-$#endif
-$#ifndef _Standard_DefineAlloc_HeaderFile
 $#include <Standard_DefineAlloc.hxx>
-$#endif
-$#ifndef _Standard_Macro_HeaderFile
 $#include <Standard_Macro.hxx>
-$#endif
 $
 $%TICIncludes
 $
 $%ClassComment
-$class %Class %Inherits {
+$class %Class %Inherits
+${
 $public:
 $
 $  DEFINE_STANDARD_ALLOC
@@ -178,7 +157,6 @@ $%TICPublicmets
 $
 $%TICPublicfriends
 $
-$
 $protected:
 $
 $%TICProtectedmets
@@ -197,10 +175,9 @@ $%TICDefines
 $%TICInlineIncludes
 $%TICUndefines
 $
-$// other Inline functions and methods (like "C++: function call" methods)
 $%TICSuppMethod
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template MPVIxx (%Class,%Suffix,%Supplement,%Methods) is
@@ -243,22 +220,17 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#ifndef _Standard_HeaderFile
 $#include <Standard.hxx>
-$#endif
-$#ifndef _Standard_DefineAlloc_HeaderFile
 $#include <Standard_DefineAlloc.hxx>
-$#endif
-$#ifndef _Standard_Macro_HeaderFile
 $#include <Standard_Macro.hxx>
-$#endif
 $
 $%TICIncludes
 $
 $Standard_EXPORT const Handle(Standard_Type)& STANDARD_TYPE(%Class);
 $
 $%ClassComment
-$class %Class %Inherits {
+$class %Class %Inherits
+${
 $
 $public:
 $
@@ -283,10 +255,9 @@ $%TICDefines
 $%TICInlineIncludes
 $%TICUndefines
 $
-$// other Inline functions and methods (like "C++: function call" methods)
 $%TICSuppMethod
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template StorableIxx(%Class,%Suffix,%Supplement,%Methods) is
@@ -297,9 +268,7 @@ $// this header file considered to be the "object code" form of the original sou
 $
 $#include <%Class.%Suffix>
 $
-$#ifndef _Standard_Type_HeaderFile
 $#include <Standard_Type.hxx>
-$#endif
 $
 $%Supplement 
 $
@@ -319,16 +288,15 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
+$#include <Standard_PrimitiveTypes.hxx>
+$
 $%EnumComment
-$enum %Class {
+$enum %Class
+${
 $%Values
 $};
 $
-$#ifndef _Standard_PrimitiveTypes_HeaderFile
-$#include <Standard_PrimitiveTypes.hxx>
-$#endif
-$
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template EnumCXX(%Class,%Values,%Nb) is
@@ -347,16 +315,14 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#ifndef _%Inherits_HeaderFile
 $#include <%Inherits.hxx>
-$#endif
 $
 $typedef %Inherits %Class;
 $%HandleTypedef
 $
 $#define %Class_Type_() %Inherits_Type_()
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 -- ==================
@@ -373,10 +339,9 @@ $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
 $class %Inherits;
-$
 $typedef %Inherits* %Class;
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 -- =====================
@@ -391,36 +356,23 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#ifndef _Standard_HeaderFile
 $#include <Standard.hxx>
-$#endif
-$#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) \
 $  if (CONDITION) %Class::Raise(MESSAGE);
 $#else
-$#define %Class_Raise_if(CONDITION,MESSAGE)
+$  #define %Class_Raise_if(CONDITION, MESSAGE)
 $#endif
 $
-$DEFINE_STANDARD_EXCEPTION(%Class,%Inherits)
+$DEFINE_STANDARD_EXCEPTION(%Class, %Inherits)
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template ExceptionMethod(%Class) is
@@ -432,9 +384,7 @@ $IMPLEMENT_STANDARD_EXCEPTION(%Class)
 -- ==============
 
 @template Include(%IClass,%Suffix) is
-$#ifndef _%IClass_HeaderFile
 $#include <%IClass.%Suffix>
-$#endif
 @end; 
 
 @template IncludeNoSafe(%IClass,%Suffix) is
index 5f5ea027562c023b06882e057e24de99c4b11e98..6e4963613883b2e5d61a7be485e470a2a2dc6b81 100755 (executable)
@@ -16,18 +16,10 @@ $
 $#ifndef _Handle_%HPName_HeaderFile
 $#define _Handle_%HPName_HeaderFile
 $
-$#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_%HPInherits_HeaderFile
 $#include <Handle_%HPInherits.hxx>
-$#endif
 $
 $class Standard_Persistent;
 $class Handle(Standard_Type);
@@ -62,22 +54,15 @@ $
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#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
 $
-$class %Class : public %Inherits {
+$class %Class : public %Inherits
+${
 $
 $public:
 $
@@ -102,10 +87,9 @@ $%TICDefines
 $%TICInlineIncludes
 $%TICUndefines
 $
-$// other Inline functions and methods (like "C++: function call" methods)
 $%TICSuppMethod
 $
-$#endif
+$#endif // _%Class_HeaderFile
 @end;
 
 @template PersistentCSFDBIxx(%Class,%Suffix,%Supplement,%TypeMgt,%Methods) is
@@ -116,9 +100,7 @@ $// this header file considered to be the "object code" form of the original sou
 $
 $#include <%Class.%Suffix>
 $
-$#ifndef _Standard_Type_HeaderFile
 $#include <Standard_Type.hxx>
-$#endif
 $
 $%Supplement 
 $
@@ -168,4 +150,3 @@ $// DBC_VArray : field
 $//
 $#endif
 @end;
-
index d2faf5b265efb3601ceb5555be3338524d5d6691..9d1dd0ebc6c1d1de9b7da1e9c2ca96ab8a82e103 100755 (executable)
@@ -32,60 +32,58 @@ $#pragma pointer_size restore
 $#endif
 $#endif
 $
-$#ifndef _Handle_%HPInherits_HeaderFile
 $#include <Handle_%HPInherits.hxx>
-$#endif
 $
 $class Oid_%HPName;
 $class %HPName;
 $
-$class Handle_%HPName: public Handle_%HPInherits {
+$class Handle_%HPName: public Handle_%HPInherits
+${
 $
 $public:
 $
-$ Handle_%HPName();
-$ Handle_%HPName(const Handle_%HPName& AnObject);
-$ Handle_%HPName(const %HPName_ptr AnObject);
-$ Standard_EXPORT ~Handle_%HPName();
-$ Handle_%HPName& operator=(const Handle_%HPName& AnObject);
-$ Standard_EXPORT Handle_%HPName& operator=(const %HPName_ptr AnObject);
-$ Standard_EXPORT static const Handle_%HPName DownCast(const Handle_Standard_Persistent&);
-$ Standard_Boolean   operator==(const Handle_%HPName& AnObject) const ;
-$ Standard_Boolean operator!=(const Handle_%HPName& AnObject) const;
-$ Oid_%HPName* operator->() const;
+$  Handle_%HPName();
+$  Handle_%HPName(const Handle_%HPName& AnObject);
+$  Handle_%HPName(const %HPName_ptr AnObject);
+$  Standard_EXPORT ~Handle_%HPName();
+$  Handle_%HPName& operator=(const Handle_%HPName& AnObject);
+$  Standard_EXPORT Handle_%HPName& operator=(const %HPName_ptr AnObject);
+$  Standard_EXPORT static const Handle_%HPName DownCast(const Handle_Standard_Persistent&);
+$  Standard_Boolean   operator==(const Handle_%HPName& AnObject) const ;
+$  Standard_Boolean operator!=(const Handle_%HPName& AnObject) const;
+$  Oid_%HPName* operator->() const;
 $};
 $
-$
 $Handle_%HPName::Handle_%HPName()
 ${
 $}
 $
-$Handle_%HPName::Handle_%HPName(const Handle_%HPName& AnObject) 
-$ : Handle_%HPInherits(AnObject)
+$Handle_%HPName::Handle_%HPName (const Handle_%HPName& theObject)
+$: Handle_%HPInherits (theObject)
 ${
 $}
 $
-$Handle_%HPName::Handle_%HPName(const %HPName_ptr AnObject) 
-$ : Handle_%HPInherits((const %HPInherits_ptr)AnObject)
+$Handle_%HPName::Handle_%HPName (const %HPName_ptr theObject)
+$: Handle_%HPInherits ((const %HPInherits_ptr)theObject)
 ${
 $}
 $
-$Handle_%HPName& Handle_%HPName::operator=(const Handle_%HPName& AnObject) 
+$Handle_%HPName& Handle_%HPName::operator= (const Handle_%HPName& theObject)
 ${
-$  Identifier=AnObject.Identifier; return *this;
+$  Identifier = theObject.Identifier; return *this;
 $}
 $
-$Standard_Boolean Handle_%HPName::operator==(const Handle_%HPName& AnObject)const 
+$Standard_Boolean Handle_%HPName::operator== (const Handle_%HPName& theObject) const
 ${
-$  return Identifier==AnObject.Identifier;
+$  return Identifier == theObject.Identifier;
 $}
 $
-$Standard_Boolean Handle_%HPName::operator!=(const Handle_%HPName& AnObject)const 
+$Standard_Boolean Handle_%HPName::operator!= (const Handle_%HPName& theObject) const
 ${
-$  return Identifier!=AnObject.Identifier;
+$  return Identifier != theObject.Identifier;
 $}
 $
-$Oid_%HPName* Handle_%HPName::operator->() const 
+$Oid_%HPName* Handle_%HPName::operator->() const
 ${
 $  return (Oid_%HPName*)(void*)&(((Handle_%HPName_ptr)this)->Identifier);
 $}
@@ -134,16 +132,15 @@ $#pragma pointer_size restore
 $#endif
 $#endif
 $
-$#ifndef _Handle_%Class_HeaderFile
 $#include <Handle_%Class.hxx>
-$#endif
 $
 $%TICIncludes
 $#ifndef _Standard_ImmutableObject_HeaderFile
 $#include <Standard_ImmutableObject.hxx>
 $#endif
 $
-$class Oid_%Class : public Oid_%Inherits {
+$class Oid_%Class : public Oid_%Inherits
+${
 $
 $friend class %Class;
 $%TICPublicfriends
@@ -151,8 +148,8 @@ $
 $public:
 $
 $%TICOidpubMet 
-$Oid_%Class() {};
-$~Oid_%Class() {};
+$  Oid_%Class() {};
+$  ~Oid_%Class() {};
 $
 $protected:
 $
index 578f731b7326d82e6be6d021f9a30ed98a70e4e0..91edd9470057e82af0a0e7cf32a725142d38d713 100755 (executable)
@@ -113,16 +113,13 @@ $//
 $#ifndef _%Class_HeaderFile
 $#define _%Class_HeaderFile
 $
-$#ifndef _Handle_%Class_HeaderFile
 $#include <Handle_%Class.hxx>
-$#endif
 $
 $%TICIncludes
-$#ifndef _Standard_ImmutableObject_HeaderFile
 $#include <Standard_ImmutableObject.hxx>
-$#endif
 $
-$class Oid_%Class : public Oid_%Inherits {
+$class Oid_%Class : public Oid_%Inherits
+${
 $
 $friend class %Class;
 $%TICPublicfriends
@@ -130,8 +127,8 @@ $
 $public:
 $
 $%TICOidpubMet 
-$Oid_%Class() {};
-$~Oid_%Class() {};
+$  Oid_%Class() {};
+$  ~Oid_%Class() {};
 $
 $protected:
 $
@@ -142,20 +139,17 @@ $
 $%TICOidpriMet 
 $};
 $
-$class %Class : public %Inherits {
+$class %Class : public %Inherits
+${
 $
 $friend class Oid_%Class;
 $
 $public:
 $
-$ // Methods PUBLIC
-$ // 
 $%TICPublicmets
 $
 $%TICPublicfriends
 $
-$ // Type management
-$ //
 $ friend Handle_Standard_Type& %Class_Type_();
 $ const Handle(Standard_Type)& DynamicType() const;
 $ Standard_Boolean            IsKind(const Handle(Standard_Type)&) const;
@@ -163,22 +157,14 @@ $ void* operator new(size_t);
 $
 $protected:
 $
-$ // Methods PROTECTED
-$ // 
 $%TICProtectedmets
 $
-$ // Fields PROTECTED
-$ //
 $%TICProtectedfields
 $
 $private: 
 $
-$ // Methods PRIVATE
-$ // 
 $%TICPrivatemets
 $
-$ // Fields PRIVATE
-$ //
 $%TICPrivatefields
 $%TICPrivatefriends
 $};
@@ -187,8 +173,6 @@ $%TICDefines
 $%TICInlineIncludes
 $%TICUndefines
 $
-$// other Inline functions and methods (like "C++: function call or Oid methods" methods)
-$//
 $%TICSuppMethod
 $
 $#endif
@@ -202,27 +186,24 @@ $// this header file considered to be the "object code" form of the original sou
 $//
 $#include <%Class.%Suffix>
 $
-$#ifndef _Standard_TypeMismatch_HeaderFile
 $#include <Standard_TypeMismatch.hxx>
-$#endif
 $
 $%Supplement 
 $
 $%TypeMgt
 $
-$ // new operator
-$ //
-$ void* %Class::operator new (size_t ASize) 
-$ {
-$   Standard_Container _aContainer = PreNew();
-$   return (opiNewObj(ASize,ooTypeN(%Class),_aContainer));
-$ }
-$
-$ Handle_%Class& Handle_%Class::operator=(const %Class* AnObject) 
-$ {
-$   Identifier = AnObject; 
-$   return *this;
-$ }
+$// new operator
+$void* %Class::operator new (size_t theSize)
+${
+$  Standard_Container _aContainer = PreNew();
+$  return (opiNewObj(theSize, ooTypeN(%Class),_aContainer));
+$}
+$
+$Handle_%Class& Handle_%Class::operator= (const %Class* theObject)
+${
+$  Identifier = theObject;
+$  return *this;
+$}
 $
 $%Methods
 @end;
index ab35dcad97c09bd0874b4671c58209c2837b5987..c0ff2dd7a0956897b9d007e4b6b00d3f053656ef 100755 (executable)
@@ -86,8 +86,10 @@ void CPP_TransientDerivated(const Handle(MS_MetaSchema)& aMeta,
 
   api->AddVariable(VSuffix,"hxx");
   
-  for (i = 1; i <= inclist->Length(); i++) {
-    api->AddVariable(VIClass,inclist->Value(i)->ToCString());
+  for (i = 1; i <= inclist->Length(); i++)
+  {
+    Handle(TCollection_HAsciiString) aName = CPP_WithoutHandleSuffix (inclist->Value (i));
+    api->AddVariable (VIClass, aName->ToCString());
     api->Apply(VoutClass,"Include");
     result->AssignCat(api->GetVariableValue(VoutClass));
   }
@@ -368,14 +370,19 @@ void CPP_TransientClass(const Handle(MS_MetaSchema)& aMeta,
 
     api->AddVariable(VSuffix,"hxx");
 
-    for (i = 1; i <= List->Length(); i++) {
-      if (!List->Value(i)->IsSameString(theClass->FullName())) {
-       api->AddVariable(VIClass,List->Value(i)->ToCString());
-       api->Apply(VTICIncludes,"Include");
-       publics->AssignCat(api->GetVariableValue(VTICIncludes));
+    for (i = 1; i <= List->Length(); i++)
+    {
+      Handle(TCollection_HAsciiString) aName = List->Value (i);
+      if (aName->IsSameString (theClass->FullName()))
+      {
+        continue;
       }
-    }
 
+      ///aName = CPP_WithoutHandleSuffix (aName);
+      api->AddVariable (VIClass, aName->ToCString());
+      api->Apply (VTICIncludes, "Include");
+      publics->AssignCat (api->GetVariableValue (VTICIncludes));
+    }
 
     for (i = 1; i <= incp->Length(); i++) {
       if (!incp->Value(i)->IsSameString(theClass->FullName())) {