From: ptv Date: Fri, 30 Jun 2006 09:01:33 +0000 (+0000) Subject: make macros more understandable + do not use pointer of temporary created TCollection... X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~26 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=11aa54c4a529718bba62aef372271d1a544f6fd8;p=modules%2Fkernel.git make macros more understandable + do not use pointer of temporary created TCollection_AsciiString for comparing. --- diff --git a/src/SALOMEDS/SALOMEDS_Attributes.hxx b/src/SALOMEDS/SALOMEDS_Attributes.hxx index c27e95d2d..cc4182684 100644 --- a/src/SALOMEDS/SALOMEDS_Attributes.hxx +++ b/src/SALOMEDS/SALOMEDS_Attributes.hxx @@ -87,43 +87,43 @@ #include "SALOMEDS_AttributeGraphic_i.hxx" #include "SALOMEDS_AttributeParameter_i.hxx" -#define __CreateCORBAAttribute(CORBA_Name) if (strcmp(aTypeOfAttribute, #CORBA_Name) == 0) { \ +#define __CreateCORBAAttribute(TypeOfAttr,OutAttribute,CORBA_Name) if (strcmp(TypeOfAttr, #CORBA_Name) == 0) { \ Handle(SALOMEDSImpl_##CORBA_Name) A = Handle(SALOMEDSImpl_##CORBA_Name)::DownCast(theAttr); \ SALOMEDS_##CORBA_Name##_i* Attr = new SALOMEDS_##CORBA_Name##_i(A, theOrb); \ attr_servant = Attr; \ - anAttribute = Attr->CORBA_Name::_this(); \ + OutAttribute = Attr->CORBA_Name::_this(); \ } -#define __CreateGenericCORBAAttribute \ -__CreateCORBAAttribute(AttributeReal) \ -__CreateCORBAAttribute(AttributeInteger) \ -__CreateCORBAAttribute(AttributeSequenceOfReal) \ -__CreateCORBAAttribute(AttributeSequenceOfInteger) \ -__CreateCORBAAttribute(AttributeName) \ -__CreateCORBAAttribute(AttributeComment) \ -__CreateCORBAAttribute(AttributeIOR) \ -__CreateCORBAAttribute(AttributePixMap) \ -__CreateCORBAAttribute(AttributeLocalID) \ -__CreateCORBAAttribute(AttributeTableOfInteger) \ -__CreateCORBAAttribute(AttributeTableOfReal) \ -__CreateCORBAAttribute(AttributeTableOfString) \ -__CreateCORBAAttribute(AttributePythonObject) \ -__CreateCORBAAttribute(AttributePersistentRef) \ -__CreateCORBAAttribute(AttributeDrawable) \ -__CreateCORBAAttribute(AttributeSelectable) \ -__CreateCORBAAttribute(AttributeExpandable) \ -__CreateCORBAAttribute(AttributeOpened) \ -__CreateCORBAAttribute(AttributeTextColor) \ -__CreateCORBAAttribute(AttributeTextHighlightColor) \ -__CreateCORBAAttribute(AttributeTarget) \ -__CreateCORBAAttribute(AttributeStudyProperties) \ -__CreateCORBAAttribute(AttributeExternalFileDef) \ -__CreateCORBAAttribute(AttributeFileType) \ -__CreateCORBAAttribute(AttributeFlags) \ -__CreateCORBAAttribute(AttributeGraphic) \ -__CreateCORBAAttribute(AttributeTreeNode) \ -__CreateCORBAAttribute(AttributeUserID) \ -__CreateCORBAAttribute(AttributeParameter) +#define __CreateGenericCORBAAttribute(TypeOfAttr,OutAttribute) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeReal) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeInteger) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeSequenceOfReal) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeSequenceOfInteger) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeName) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeComment) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeIOR) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributePixMap) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeLocalID) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTableOfInteger) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTableOfReal) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTableOfString) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributePythonObject) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributePersistentRef) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeDrawable) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeSelectable) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeExpandable) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeOpened) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTextColor) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTextHighlightColor) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTarget) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeStudyProperties) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeExternalFileDef) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeFileType) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeFlags) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeGraphic) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeTreeNode) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeUserID) \ +__CreateCORBAAttribute(TypeOfAttr,OutAttribute,AttributeParameter) #endif diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx index 8ab64d6ab..f5f8d7aed 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute_i.cxx @@ -119,11 +119,11 @@ SALOMEDS::GenericAttribute_ptr SALOMEDS_GenericAttribute_i::CreateAttribute } */ // mpv: now servants Destroyed by common algos of CORBA - char* aTypeOfAttribute = Handle(SALOMEDSImpl_GenericAttribute):: - DownCast(theAttr)->GetClassType().ToCString(); + TCollection_AsciiString aTypeOfAttribute = Handle(SALOMEDSImpl_GenericAttribute):: + DownCast(theAttr)->GetClassType(); SALOMEDS::GenericAttribute_var anAttribute; SALOMEDS_GenericAttribute_i* attr_servant = NULL; - __CreateGenericCORBAAttribute + __CreateGenericCORBAAttribute( aTypeOfAttribute.ToCString(), anAttribute ); return anAttribute._retn(); }