|
From: Chris M. <zm...@us...> - 2001-09-10 22:09:36
|
Update of /cvsroot/kuml/kuml/libkuml/uml/tools
In directory usw-pr-cvs1:/tmp/cvs-serv12655
Modified Files:
common_proxy_code.xsl gen_assoc_hs.xsl gen_class_ccs.xsl
gen_class_hs.xsl gen_proxy_ccs.xsl
Log Message:
Class bits work completely (for Core, others uncompiled)
Proxys work for Core with minor mods (patches in the pipeline).
Index: common_proxy_code.xsl
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/common_proxy_code.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** common_proxy_code.xsl 2001/08/07 22:35:54 1.1
--- common_proxy_code.xsl 2001/09/10 22:09:32 1.2
***************
*** 12,16 ****
<xsl:template
! match="Model:DataType | Model:DataType.typeCode | XMI.CorbaTypeCode"
mode="create_param_type_name">
<xsl:param name="collection"/>
--- 12,16 ----
<xsl:template
! match="Model:DataType | Model:DataType.typeCode | XMI.CorbaTypeCode | XMI.CorbaTcAlias"
mode="create_param_type_name">
<xsl:param name="collection"/>
***************
*** 31,35 ****
! <xsl:template match="XMI.CorbaTcAlias" mode="create_param_type_name">
<xsl:param name="collection"/>
--- 31,35 ----
! <xsl:template match="XMI.CorbaTcString" mode="create_param_type_name">
<xsl:param name="collection"/>
***************
*** 43,68 ****
</xsl:variable>
! <xsl:variable name="type_name" select="@xmi.tcName"/>
<xsl:choose>
<xsl:when test='not(string-length($collection) = 0)'>
<xsl:text>const Core</xsl:text>
</xsl:when>
<xsl:otherwise>
! <xsl:value-of select="$package_name"/>
</xsl:otherwise>
</xsl:choose>
- <xsl:text>::</xsl:text>
- <xsl:value-of select="$type_name"/>
- <xsl:value-of select="$collection"/>
-
- </xsl:template>
-
- <!-- If we got this far it must be xmi.id='a23' name='String' -->
- <xsl:template match="XMI.CorbaTcString" mode="create_param_type_name">
- <xsl:param name="collection"/>
- <xsl:text>const char*</xsl:text>
</xsl:template>
--- 43,62 ----
</xsl:variable>
! <xsl:variable name="type_name" select="ancestor::Model:DataType/@name"/>
<xsl:choose>
<xsl:when test='not(string-length($collection) = 0)'>
<xsl:text>const Core</xsl:text>
+ <xsl:text>::</xsl:text>
+ <xsl:value-of select="$type_name"/>
+ <xsl:value-of select="$collection"/>
</xsl:when>
<xsl:otherwise>
! <!-- xsl:value-of select="$package_name"/ -->
! <xsl:text>const char*</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Index: gen_assoc_hs.xsl
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_assoc_hs.xsl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** gen_assoc_hs.xsl 2001/05/16 22:21:39 1.2
--- gen_assoc_hs.xsl 2001/09/10 22:09:32 1.3
***************
*** 24,27 ****
--- 24,114 ----
</xsl:variable>
+ <xsl:variable name="assoc_name">
+ <xsl:call-template name="to_name">
+ <xsl:with-param name="text">
+ <xsl:value-of select="$assocName"/>
+ </xsl:with-param>
+ <xsl:with-param name="position" select="1"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- Get association end 1 -->
+ <xsl:variable name="assocEnd1Name">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@name'/>
+ </xsl:variable>
+
+ <xsl:variable name="assoc_end1_name">
+ <xsl:call-template name="to_name">
+ <xsl:with-param name="text">
+ <xsl:value-of select="$assocEnd1Name"/>
+ </xsl:with-param>
+ <xsl:with-param name="position" select="1"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd1Type">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@type'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd1TypeName">
+ <xsl:value-of select='/descendant::Model:Class[@xmi.id=$assocEnd1Type]/@name'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd1_is_navigable">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@isNavigable'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd1_is_changeable">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/@isChangeable'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd1_upper">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/Model:AssociationEnd.multiplicity/XMI.field[position()=2]'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd1_is_ordered">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=1]/Model:AssociationEnd.multiplicity/XMI.field[position()=3]'/>
+ </xsl:variable>
+
+ <!-- Get association end 2 -->
+ <xsl:variable name="assocEnd2Name">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@name'/>
+ </xsl:variable>
+
+ <xsl:variable name="assoc_end2_name">
+ <xsl:call-template name="to_name">
+ <xsl:with-param name="text">
+ <xsl:value-of select="$assocEnd2Name"/>
+ </xsl:with-param>
+ <xsl:with-param name="position" select="1"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd2Type">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@type'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd2TypeName">
+ <xsl:value-of select='/descendant::Model:Class[@xmi.id=$assocEnd2Type]/@name'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd2_is_navigable">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@isNavigable'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd2_is_changeable">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/@isChangeable'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd2_upper">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/Model:AssociationEnd.multiplicity/XMI.field[position()=2]'/>
+ </xsl:variable>
+
+ <xsl:variable name="assocEnd2_is_ordered">
+ <xsl:value-of select='./Model:Namespace.contents/Model:AssociationEnd[position()=2]/Model:AssociationEnd.multiplicity/XMI.field[position()=3]'/>
+ </xsl:variable>
+
+ <!-- DO THE OUTPUT -->
+
<xsl:text>#ifdef __</xsl:text>
<xsl:value-of select="$ASSOC_NAME"/>
***************
*** 42,49 ****
<xsl:text> </xsl:text>
<xsl:text>class </xsl:text>
<xsl:value-of select="$assocName"/>
! <xsl:text> : Reflective::RefAssociation</xsl:text>
</xsl:template>
--- 129,437 ----
<xsl:text> </xsl:text>
+ <xsl:text> // assocEnd1Name </xsl:text>
+ <xsl:value-of select="$assocEnd1Name"/>
+ <xsl:text> </xsl:text>
+
+ <xsl:text> // assocEnd1_is_navigable </xsl:text>
+ <xsl:value-of select="$assocEnd1_is_navigable"/>
+ <xsl:text> </xsl:text>
+
+ <xsl:text> // assocEnd2Name </xsl:text>
+ <xsl:value-of select="$assocEnd2Name"/>
+ <xsl:text> </xsl:text>
+
+ <xsl:text> // assocEnd2_is_navigable </xsl:text>
+ <xsl:value-of select="$assocEnd2_is_navigable"/>
+ <xsl:text> </xsl:text>
+
+ <xsl:text> </xsl:text>
+
<xsl:text>class </xsl:text>
+ <xsl:value-of select="$assocName"/>
+ <xsl:text>_impl : </xsl:text>
+
+ <xsl:text> virtual public RefAssociation_impl, </xsl:text>
+
+ <xsl:text> virtual public POA_Core::</xsl:text>
+ <xsl:value-of select="$assocName"/>
+ <xsl:text>_impl </xsl:text>
+ <xsl:text>{ </xsl:text>
+
+ <!-- // list of associated elements
+ <AssociationName>LinkSet all_ <association_name>_links ()
+ raises (Reflective::MofError);
+ -->
+
+ <xsl:text> </xsl:text>
<xsl:value-of select="$assocName"/>
! <xsl:text>LinkSet all_</xsl:text>
! <xsl:value-of select="$assoc_name"/>
! <xsl:text>_links () </xsl:text>
!
! <xsl:text> throw( </xsl:text>
! <xsl:text> ::CORBA::SystemException, </xsl:text>
! <xsl:text> ::Reflective::MofError) </xsl:text>
! <xsl:text> ; </xsl:text>
! <xsl:text> </xsl:text>
!
! <!-- boolean exists ( in <AssociationEnd1Class> <association_end1_name>,
! in <AssociationEnd2Class> <association_end2_name>)
! raises (Reflective::MofError);
! -->
!
! <xsl:text> </xsl:text>
! <xsl:text>CORBA::Boolean exists( Core::</xsl:text>
! <xsl:value-of select="$assocEnd1TypeName"/>
! <xsl:text>_ptr </xsl:text>
! <xsl:value-of select="$assoc_end1_name"/>
! <xsl:text> , Core::</xsl:text>
! <xsl:value-of select="$assocEnd2TypeName"/>
! <xsl:text>_ptr </xsl:text>
! <xsl:value-of select="$assoc_end2_name"/>
! <xsl:text> ) </xsl:text>
!
! <xsl:text> throw( </xsl:text>
! <xsl:text> ::CORBA::SystemException, </xsl:text>
! <xsl:text> ::Reflective::MofError) </xsl:text>
! <xsl:text> ; </xsl:text>
! <xsl:text> </xsl:text>
+ <xsl:if test='$assocEnd1_is_navigable = "true"'>
+
+ <!-- <AssociationEnd1Class>[<CollectionKind>] <association_end1_name>
+ ( in <AssociationEnd2Class> <association_end2_name>)
+ raises (Reflective::MofError);
+ -->
+
+ <xsl:text> Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>Set* </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text> ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text> ; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+ <xsl:if test='$assocEnd2_is_navigable = "true"'>
+
+ <!-- <AssociationEnd2Class>[<CollectionKind>] <association_end2_name>
+ ( in <AssociationEnd1Class> <association_end1_name>)
+ raises (Reflective::MofError);
+ -->
+
+ <xsl:text> Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>Set* </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text> ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text> ; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+
+ <xsl:if test='$assocEnd1_is_changeable = "true" and $assocEnd2_is_changeable = "true"'>
+
+ <!-- void add ( in <AssociationEnd1Class> <association_end1_name>,
+ in <AssociationEnd2Class> <association_end2_name>)
+ raises (Reflective::MofError);
+ -->
+
+ <xsl:text> void add ( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text> ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text> ; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+ <xsl:if test='$assocEnd1_is_changeable = "true" and
+ $assocEnd1_is_navigable = "true" and
+ $assocEnd2_is_changeable = "true" and
+ ($assocEnd1_upper > 1 or $assocEnd1_upper = -1) and
+ $assocEnd1_is_ordered = "true"'>
+
+ <!-- void add_before_ <association_end1_name>
+ ( in <AssociationEnd1Class> <association_end1_name>,
+ in <AssociationEnd2Class> <association_end2_name>,
+ in <AssociationEnd1Class> before)
+ raises (Reflective::NotFound, Reflective::MofError);
+ -->
+
+ <xsl:text> void add_before_</xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr before ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::NotFound, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text>; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+ <xsl:if test='$assocEnd1_is_changeable = "true" and
+ $assocEnd2_is_changeable = "true" and
+ $assocEnd2_is_navigable = "true" and
+ ($assocEnd2_upper > 1 or $assocEnd2_upper = -1) and
+ $assocEnd2_is_ordered = "true"'>
+
+ <!-- void add_before_ <association_end2_name>
+ ( in <AssociationEnd1Class> <association_end1_name>,
+ in <AssociationEnd2Class> <association_end2_name>,
+ in <AssociationEnd2Class> before)
+ raises (Reflective::NotFound, Reflective::MofError);
+ -->
+
+ <xsl:text> void add_before_</xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr before ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::NotFound, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text>; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+ <xsl:if test='$assocEnd1_is_navigable = "true" and
+ $assocEnd1_is_changeable = "true"'>
+
+ <!-- void modify_ <association_end1_name>
+ ( in <AssociationEnd1Class> <association_end1_name>,
+ in <AssociationEnd2Class> <association_end2_name>,
+ in <AssociationEnd1Class> new_ <association_end1_name>)
+ raises (Reflective::NotFound, Reflective::MofError);
+ -->
+
+ <xsl:text> void modify_</xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr</xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr new_</xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text> ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::NotFound, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text> ; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+ <xsl:if test='$assocEnd2_is_navigable = "true" and
+ $assocEnd2_is_changeable = "true"'>
+
+ <!-- void modify_ <association_end2_name>
+ ( in <AssociationEnd1Class> <association_end1_name>,
+ in <AssociationEnd2Class> <association_end2_name>,
+ in <AssociationEnd2Class> new_ <association_end2_name>)
+ raises (Reflective::NotFound, Reflective::MofError);
+ -->
+
+ <xsl:text> void modify_</xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr</xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr new_</xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text> ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::NotFound, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text> ; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
+ <xsl:if test='$assocEnd1_is_changeable = "true" and
+ $assocEnd2_is_changeable = "true"'>
+
+ <!-- void remove ( in <AssociationEnd1Class> <association_end1_name>,
+ in <AssociationEnd2Class> <association_end2_name>)
+ raises (Reflective::NotFound, Reflective::MofError);
+ -->
+
+ <xsl:text>void remove( Core::</xsl:text>
+ <xsl:value-of select="$assocEnd1TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end1_name"/>
+ <xsl:text>, Core::</xsl:text>
+ <xsl:value-of select="$assocEnd2TypeName"/>
+ <xsl:text>_ptr </xsl:text>
+ <xsl:value-of select="$assoc_end2_name"/>
+ <xsl:text> ) </xsl:text>
+ <xsl:text> throw( </xsl:text>
+ <xsl:text> ::CORBA::SystemException, </xsl:text>
+ <xsl:text> ::Reflective::NotFound, </xsl:text>
+ <xsl:text> ::Reflective::MofError) </xsl:text>
+ <xsl:text>; </xsl:text>
+ <xsl:text> </xsl:text>
+
+ </xsl:if>
+
</xsl:template>
***************
*** 68,97 ****
<xsl:template match="Model:Association">
- <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/>
- <xsl:variable name="assoc_name" select="@name"/>
- <xsl:variable name="assocName">
- <xsl:call-template name="toName">
- <xsl:with-param name="text">
- <xsl:value-of select="@name"/>
- </xsl:with-param>
- <xsl:with-param name="position" select="1"/>
- </xsl:call-template>
- </xsl:variable>
! <xsl:variable name="filename">
! <xsl:text>../</xsl:text>
! <xsl:value-of select="$package_name"/>
! <xsl:text>/</xsl:text>
! <xsl:value-of select="$assocName"/>
! <xsl:text>_impl.h</xsl:text>
! </xsl:variable>
! <xalan:write select="$filename">
! <xsl:call-template name="ASSOCIATION">
! <xsl:with-param name="assocName">
! <xsl:value-of select="$assocName"/>
! </xsl:with-param>
! </xsl:call-template>
! </xalan:write>
</xsl:template>
--- 456,490 ----
<xsl:template match="Model:Association">
! <xsl:if test='@visibility = "public_vis"'>
! <xsl:variable name="package_name" select="ancestor::Model:Package/@name"/>
! <xsl:variable name="assoc_name" select="@name"/>
! <xsl:variable name="assocName">
! <xsl:call-template name="toName">
! <xsl:with-param name="text">
! <xsl:value-of select="@name"/>
! </xsl:with-param>
! <xsl:with-param name="position" select="1"/>
! </xsl:call-template>
! </xsl:variable>
!
! <xsl:variable name="filename">
! <xsl:text>../</xsl:text>
! <xsl:value-of select="$package_name"/>
! <xsl:text>/</xsl:text>
! <xsl:value-of select="$assocName"/>
! <xsl:text>_impl.h</xsl:text>
! </xsl:variable>
!
! <xalan:write select="$filename">
! <xsl:call-template name="ASSOCIATION">
! <xsl:with-param name="assocName">
! <xsl:value-of select="$assocName"/>
! </xsl:with-param>
! </xsl:call-template>
! </xalan:write>
!
! </xsl:if>
</xsl:template>
Index: gen_class_ccs.xsl
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_class_ccs.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** gen_class_ccs.xsl 2001/07/26 21:18:43 1.6
--- gen_class_ccs.xsl 2001/09/10 22:09:32 1.7
***************
*** 319,323 ****
</xsl:if>
! <xsl:if test='$lower = 0 and $upper = 1 and $is_changeable="true"'>
<!-- void unset_ <attribute_name> () raises (Reflective::MofError);
--- 319,325 ----
</xsl:if>
! <!-- Note: this doesn't match the MOF spec but does match the published idl.
! Unseting a multiple attribute seems valid. -->
! <xsl:if test='$lower = 0 and $is_changeable="true"'>
<!-- void unset_ <attribute_name> () raises (Reflective::MofError);
***************
*** 349,352 ****
--- 351,357 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element ) </xsl:text>
***************
*** 373,378 ****
--- 378,389 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>_before( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element, </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> before_element ) </xsl:text>
***************
*** 401,404 ****
--- 412,418 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>_at( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element, </xsl:text>
***************
*** 427,432 ****
--- 441,452 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> old_element, </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element ) </xsl:text>
***************
*** 454,457 ****
--- 474,480 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>_at( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element, </xsl:text>
***************
*** 479,482 ****
--- 502,508 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> old_element ) </xsl:text>
Index: gen_class_hs.xsl
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_class_hs.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** gen_class_hs.xsl 2001/08/07 22:35:54 1.6
--- gen_class_hs.xsl 2001/09/10 22:09:32 1.7
***************
*** 499,503 ****
</xsl:if>
! <xsl:if test='$lower = 0 and $upper = 1 and $is_changeable="true"'>
<!-- void unset_ <attribute_name> () raises (Reflective::MofError);
--- 499,505 ----
</xsl:if>
! <!-- Note: this doesn't match the MOF spec but does match the published idl.
! Unseting a multiple attribute seems valid. -->
! <xsl:if test='$lower = 0 and $is_changeable="true"'>
<!-- void unset_ <attribute_name> () raises (Reflective::MofError);
***************
*** 526,529 ****
--- 528,534 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element ) </xsl:text>
***************
*** 549,554 ****
--- 554,565 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>_before( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element, </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> before_element ) </xsl:text>
***************
*** 575,578 ****
--- 586,592 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>_at( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element, </xsl:text>
***************
*** 600,605 ****
--- 614,625 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> old_element, </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element ) </xsl:text>
***************
*** 626,629 ****
--- 646,652 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>_at( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> new_element, </xsl:text>
***************
*** 650,653 ****
--- 673,679 ----
<xsl:value-of select="$attr_name"/>
<xsl:text>( </xsl:text>
+ <xsl:if test='$is_const = true()'>
+ <xsl:text>const </xsl:text>
+ </xsl:if>
<xsl:value-of select="$CORBA_type"/>
<xsl:text> old_element ) </xsl:text>
Index: gen_proxy_ccs.xsl
===================================================================
RCS file: /cvsroot/kuml/kuml/libkuml/uml/tools/gen_proxy_ccs.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** gen_proxy_ccs.xsl 2001/08/07 22:35:54 1.1
--- gen_proxy_ccs.xsl 2001/09/10 22:09:32 1.2
***************
*** 38,48 ****
</xsl:variable>
! <xsl:text> impl->set_</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>(</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>); </xsl:text>
</xsl:template>
<xsl:template match="Model:Class" mode="set_attrs">
--- 38,117 ----
</xsl:variable>
! <xsl:variable name="lower"
! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=1]"/>
! <xsl:variable name="upper"
! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=2]"/>
! <xsl:variable name="is_ordered"
! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=3]"/>
! <xsl:variable name="is_unique"
! select="./Model:StructuralFeature.multiplicity/XMI.field[position()=4]"/>
!
! <xsl:if test='$lower=0 and $upper=1'>
!
! <xsl:variable name="type_ref" select="@type"/>
!
! <xsl:variable name="collection">
! <xsl:call-template name="collection_name"/>
! </xsl:variable>
!
! <xsl:variable name="the_C_type">
! <xsl:apply-templates
! select='/descendant::*[attribute::xmi.id=$type_ref]'
! mode="create_param_type_name">
! <xsl:with-param name="collection">
! <xsl:value-of select="$collection"/>
! </xsl:with-param>
! </xsl:apply-templates>
! </xsl:variable>
!
! <xsl:choose>
! <xsl:when test='$the_C_type = "const char*"'>
!
! <xsl:text> impl->set_</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>(</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>); </xsl:text>
!
! </xsl:when>
! <xsl:otherwise>
!
! <xsl:text> if (</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>.length() > 0) </xsl:text>
!
! <xsl:text> impl->set_</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>(</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>[0]); </xsl:text>
!
! </xsl:otherwise>
! </xsl:choose>
!
! </xsl:if>
!
! <xsl:if test='$lower=1 and $upper=1'>
!
! <xsl:text> impl->set_</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>(</xsl:text>
! <xsl:value-of select="$the_attr"/>
! <xsl:text>); </xsl:text>
!
! </xsl:if>
+ <xsl:if test='$upper > 1 or $upper=-1'>
+
+ <xsl:text> impl->set_</xsl:text>
+ <xsl:value-of select="$the_attr"/>
+ <xsl:text>(</xsl:text>
+ <xsl:value-of select="$the_attr"/>
+ <xsl:text>); </xsl:text>
+
+ </xsl:if>
+
</xsl:template>
+
<xsl:template match="Model:Class" mode="set_attrs">
|