VirtualBox

Changeset 49906 in vbox for trunk/src/VBox/Main/idl/midl.xsl


Ignore:
Timestamp:
Dec 14, 2013 9:01:04 PM (11 years ago)
Author:
vboxsync
Message:

Main: Some simple COM/XPCOM performance measurements. The idea was getting a baseline before experimenting with proxy/stub stuff in midl. There is some VirtualBox.idl preps related to that. Unforuntately, the proxy/stub generator doesn't support SAFEARRAY parameters with interface pointers other than IUnknown. So, we're probably up against something difficult here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/midl.xsl

    r43103 r49906  
    2121
    2222<xsl:strip-space elements="*"/>
     23
     24<!-- Whether to generate proxy code and type library ('yes'), or just the type-library. -->
     25<xsl:param name="g_fGenProxy" select="'no'"/>
    2326
    2427
     
    144147 *  libraries
    145148-->
    146 <xsl:template match="library">[
     149<xsl:template match="library">
     150  <xsl:if test="$g_fGenProxy = 'yes'">
     151    <!-- Declare everything outside the library and then reference these
     152         from inside the library statement.  See:
     153         http://msdn.microsoft.com/en-us/library/windows/desktop/aa366841(v=vs.85).aspx -->
     154    <xsl:text>&#x0A;</xsl:text>
     155    <!-- forward declarations -->
     156    <xsl:apply-templates select="if | interface" mode="forward"/>
     157    <xsl:text>&#x0A;</xsl:text>
     158    <!-- all enums go first -->
     159    <xsl:apply-templates select="enum | if/enum"/>
     160    <!-- everything else but result codes and enums -->
     161    <xsl:apply-templates select="*[not(self::result or self::enum) and
     162                                   not(self::if[result] or self::if[enum])]"/>
     163  </xsl:if>
     164
     165[
    147166    uuid(<xsl:value-of select="@uuid"/>),
    148167    version(<xsl:value-of select="@version"/>),
     
    161180  <xsl:apply-templates select="if | interface" mode="forward"/>
    162181  <xsl:text>&#x0A;</xsl:text>
    163   <!-- all enums go first -->
    164   <xsl:apply-templates select="enum | if/enum"/>
    165   <!-- everything else but result codes and enums -->
    166   <xsl:apply-templates select="*[not(self::result or self::enum) and
    167                                  not(self::if[result] or self::if[enum])]"/>
     182  <xsl:choose>
     183    <xsl:when test="$g_fGenProxy = 'yes'">
     184      <!-- all enums go first -->
     185      <xsl:apply-templates select="enum | if/enum" mode="forward"/>
     186    </xsl:when>
     187    <xsl:otherwise>
     188      <!-- all enums go first -->
     189      <xsl:apply-templates select="enum | if/enum"/>
     190      <!-- everything else but result codes and enums -->
     191      <xsl:apply-templates select="*[not(self::result or self::enum) and
     192                                     not(self::if[result] or self::if[enum])]"/>
     193    </xsl:otherwise>
     194  </xsl:choose>
    168195  <!-- -->
    169196  <xsl:text>}; /* library </xsl:text>
     
    190217  <xsl:value-of select="@name"/>
    191218  <xsl:text>;&#x0A;</xsl:text>
     219</xsl:template>
     220
     221
     222<xsl:template match="enum" mode="forward">
     223  <xsl:text>enum </xsl:text>
     224  <xsl:value-of select="@name"/>
     225  <xsl:text>;&#x0A;&#x0A;</xsl:text>
    192226</xsl:template>
    193227
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette