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.
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();
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();
//function : CheckCommentListIsEmpty
//purpose :
//=======================================================================
-void CheckCommentListIsEmpty (const char* /*theFunctionName*/)
+void CheckCommentListIsEmpty (const char* theFunctionName)
{
+ (void )theFunctionName;
if (TheListOfComments->IsEmpty())
{
return;
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;
}
//=======================================================================
}
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)
{
-- ==============
@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>
$#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);
$
$#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_();
$// 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_()
${
$#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;
$
$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));
$ }
$};
$
$// 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_()
${
$// 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_();
$// 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_()
${
$#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",
$ 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)(){}
$#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_();
$
$%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
$// 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;
$}
$
$//
$#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
$// 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
$
$//
$#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
$// 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
$
$#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
$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,
}
}
+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;
+}
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
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));
}
$#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;
$#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
$#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
$
$#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
$
$#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
$
$#ifndef _Handle_Standard_Persistent_HeaderFile
$#define _Handle_Standard_Persistent_HeaderFile
+$
$#include <Handle_StandardDB_Persistent.hxx>
$
-$#endif
+$#endif // _Handle_Standard_Persistent_HeaderFile
@end;
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));
}
$#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
-- ===============================
$#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:
$
$%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
$
$#include <%Class.%Suffix>
$
-$#ifndef _Standard_Type_HeaderFile
$#include <Standard_Type.hxx>
-$#endif
$
$%Supplement
$
$#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
$
$%TICPublicfriends
$
-$
$protected:
$
$%TICProtectedmets
$%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
$#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:
$
$%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
$
$#include <%Class.%Suffix>
$
-$#ifndef _Standard_Type_HeaderFile
$#include <Standard_Type.hxx>
-$#endif
$
$%Supplement
$
$#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
$#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;
-- ==================
$#define _%Class_HeaderFile
$
$class %Inherits;
-$
$typedef %Inherits* %Class;
$
-$#endif
+$#endif // _%Class_HeaderFile
@end;
-- =====================
$#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
-- ==============
@template Include(%IClass,%Suffix) is
-$#ifndef _%IClass_HeaderFile
$#include <%IClass.%Suffix>
-$#endif
@end;
@template IncludeNoSafe(%IClass,%Suffix) is
$#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);
$#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:
$
$%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
$
$#include <%Class.%Suffix>
$
-$#ifndef _Standard_Type_HeaderFile
$#include <Standard_Type.hxx>
-$#endif
$
$%Supplement
$
$//
$#endif
@end;
-
$#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);
$}
$#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
$public:
$
$%TICOidpubMet
-$Oid_%Class() {};
-$~Oid_%Class() {};
+$ Oid_%Class() {};
+$ ~Oid_%Class() {};
$
$protected:
$
$#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
$public:
$
$%TICOidpubMet
-$Oid_%Class() {};
-$~Oid_%Class() {};
+$ Oid_%Class() {};
+$ ~Oid_%Class() {};
$
$protected:
$
$%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;
$
$protected:
$
-$ // Methods PROTECTED
-$ //
$%TICProtectedmets
$
-$ // Fields PROTECTED
-$ //
$%TICProtectedfields
$
$private:
$
-$ // Methods PRIVATE
-$ //
$%TICPrivatemets
$
-$ // Fields PRIVATE
-$ //
$%TICPrivatefields
$%TICPrivatefriends
$};
$%TICInlineIncludes
$%TICUndefines
$
-$// other Inline functions and methods (like "C++: function call or Oid methods" methods)
-$//
$%TICSuppMethod
$
$#endif
$//
$#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;
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));
}
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())) {