apiwrap-server.xsl revision 3d9dd3898847de5df077eb50b194708f6359728b
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync XSLT stylesheet that generates C++ API wrappers (server side) from
ad6416604f921c978764761778bfdcd1f4984b5avboxsync Copyright (C) 2010-2015 Oracle Corporation
ad6416604f921c978764761778bfdcd1f4984b5avboxsync This file is part of VirtualBox Open Source Edition (OSE), as
ad6416604f921c978764761778bfdcd1f4984b5avboxsync available from http://www.virtualbox.org. This file is free software;
ad6416604f921c978764761778bfdcd1f4984b5avboxsync you can redistribute it and/or modify it under the terms of the GNU
ad6416604f921c978764761778bfdcd1f4984b5avboxsync General Public License (GPL) as published by the Free Software
ad6416604f921c978764761778bfdcd1f4984b5avboxsync Foundation, in version 2 as it comes in the "COPYING" file of the
ad6416604f921c978764761778bfdcd1f4984b5avboxsync VirtualBox OSE distribution. VirtualBox OSE is distributed in the
ad6416604f921c978764761778bfdcd1f4984b5avboxsync hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync version="1.0"
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync global XSLT variables
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:variable name="G_xsltFilename" select="'apiwrap-server.xsl'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsynctemplates for file separation
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('	', $file, ' \', $G_sNewLine)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat($G_sNewLine, '// ##### BEGINFILE "', $file, '"', $G_sNewLine)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat($G_sNewLine, '// ##### ENDFILE "', $file, '"', $G_sNewLine)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsynctemplates for file headers/footers
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' * VirtualBox API class wrapper ', $type, ' for I', $class, '.')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * DO NOT EDIT! This is a generated file.
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * Generated from: src/VBox/Main/idl/VirtualBox.xidl
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * Copyright (C) 2010-2015 Oracle Corporation
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * available from http://www.virtualbox.org. This file is free software;
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * you can redistribute it and/or modify it under the terms of the GNU
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * General Public License (GPL) as published by the Free Software
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' COM_INTERFACE_ENTRY(', $iface/@name, ')' , $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <!-- now recurse to emit all base interfaces -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="extends" select="$iface/@extends"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$extends and not($extends='$unknown') and not($extends='$errorinfo')">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="iface" select="//interface[@name=$extends]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('#ifndef ', substring(@name, 2), 'Wrap_H_', $G_sNewLine)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('#define ', substring(@name, 2), 'Wrap_H_')"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat('class ATL_NO_VTABLE ', substring(@name, 2), 'Wrap:')"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync public VirtualBoxBase,
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat(' VBOX_SCRIPTABLE_IMPL(', @name, ')')"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:if test="count(exsl:node-set($addinterfaces)/token) > 0">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:for-each select="exsl:node-set($addinterfaces)/token">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' VBOX_SCRIPTABLE_IMPL(', text(), ')')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(', substring(@name, 2), 'Wrap, ', @name, ')', $G_sNewLine)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' DECLARE_NOT_AGGREGATABLE(', substring(@name, 2), 'Wrap)', $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat(' BEGIN_COM_MAP(', substring(@name, 2), 'Wrap)', $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat(' COM_INTERFACE_ENTRY2(IDispatch, ', @name, ')', $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="option" select="'manualaddinterfaces'"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:for-each select="exsl:node-set($addinterfaces)/token">
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <!-- This is super tricky, as the for-each switches to the node
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync set, which means the normal document isn't available any more.
dcc162af9a2a47325b89f457ed215957415d3d3avboxsync So need to use the global root node to get back into the
dcc162af9a2a47325b89f457ed215957415d3d3avboxsync documemt to find corresponding interface data. -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="iface" select="$G_root//interface[@name=$addifname]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:text> COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p)
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync END_COM_MAP()
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' DECLARE_EMPTY_CTOR_DTOR(', substring(@name, 2), 'Wrap)', $G_sNewLine)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('#endif // !', substring(@name, 2), 'Wrap_H_', $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat('#define LOG_GROUP_MAIN_OVERRIDE LOG_GROUP_MAIN_', translate(substring(@name, 2), $G_lowerCase, $G_upperCase), $G_sNewLine, $G_sNewLine)"/>
c9ffb32f7bfe2b467ba3ae35d640ac7b97e50a30vboxsync <xsl:value-of select="concat('#include "', substring(@name, 2), 'Wrap.h"', $G_sNewLine)"/>
c9ffb32f7bfe2b467ba3ae35d640ac7b97e50a30vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:when test="$extends and not($extends='$unknown') and not($extends='$errorinfo')">
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="newextends" select="//interface[@name=$extends]/@extends"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="newiflist" select="concat($interfacelist, ', ', $extends)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="classname" select="$classname"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="extends" select="$newextends"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="interfacelist" select="$newiflist"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="addinterfaces_ns" select="exsl:node-set($addinterfaces)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:when test="count($addinterfaces_ns/token) > 0">
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="addifname" select="$addinterfaces_ns/token[1]"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="addif" select="//interface[@name=$addifname]/@extends"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="newextends" select="$addif/@extends"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="newaddinterfaces" select="$addinterfaces_ns/token[position() > 1]"/>
c9ffb32f7bfe2b467ba3ae35d640ac7b97e50a30vboxsync <xsl:variable name="newiflist" select="concat($interfacelist, ', ', $addifname)"/>
c9ffb32f7bfe2b467ba3ae35d640ac7b97e50a30vboxsync <xsl:with-param name="classname" select="$classname"/>
c9ffb32f7bfe2b467ba3ae35d640ac7b97e50a30vboxsync <xsl:with-param name="extends" select="$newextends"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="addinterfaces" select="$newaddinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="interfacelist" select="$newiflist"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat('NS_IMPL_THREADSAFE_ISUPPORTS', $depth, '_CI(', $classname, ', ', $interfacelist, ')', $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="concat('NS_DECL_CLASSINFO(', substring(@name, 2), 'Wrap)', $G_sNewLine)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="option" select="'manualaddinterfaces'"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:variable name="nulladdinterfaces"></xsl:variable>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="classname" select="concat(substring(@name, 2), 'Wrap')"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="addinterfaces" select="$nulladdinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="interfacelist" select="@name"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="classname" select="concat(substring(@name, 2), 'Wrap')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="interfacelist" select="@name"/>
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync templates for dealing with names and parameters
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync - - - - - - - - - - - - - - - - - - - - - - -->
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="translate($str, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_', ' ')"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="string-length($option) > 0 and contains(concat(',', translate($optionlist, ' ', ''), ','), concat(',', $option, ','))"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:value-of select="substring-before($val,$separator)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="val" select="substring-after($val,$separator)"/>
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:with-param name="separator" select="$separator"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- Micro optimizations: Put off wraptypefield calculation as long as possible; Check interfaces before enums. -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- get C++ glue type from IDL type from table in typemap-shared.inc.xsl -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename"/>
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="thatifname" select="$thatif/@name"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="msg" select="concat('translatepublictype: Type "', $type, '" is not supported.')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$dir='in' and not($safearray='yes')">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$dir='in' and not($safearray='yes')">
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <!-- Micro optimizations: Put off wraptypefield calculation as long as possible; Check interfaces before enums. -->
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <!-- get C++ wrap type from IDL type from table in typemap-shared.inc.xsl -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="wraptypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename"/>
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="thatifname" select="$thatif/@name"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$dir='in' and not($safearray='yes')">
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:value-of select="concat('ComPtr<', $thatifname, '> &')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="msg" select="concat('translatewrappedtype: Type "', $type, '" is not supported.')"/>
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <!-- get C format string for IDL type from table in typemap-shared.inc.xsl -->
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:variable name="wrapfmt" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluefmt"/>
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:when test="$mod='ptr' or ($isref='yes' and $dir!='in')">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="msg" select="concat('translatefmtcpectype: Type "', $type, '" is not supported.')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- get dtrace probe type from IDL type from table in typemap-shared.inc.xsl -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="dtracetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@dtracename"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- <xsl:value-of select="concat($type, '_T')"/> - later we can emit enums into dtrace the library -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- <xsl:text>struct IUnknown *</xsl:text> -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="thatifname" select="$thatif/@name"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('struct ', $thatifname, ' *')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="msg" select="concat('translatedtracetype Type "', $type, '" is not supported.')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync templates for handling entire interfaces and their contents
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- sources, headers and dtrace-probes all needs attribute lists -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="val" select="$iface/@wrap-hint-server-addinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="addinterfaces" select="$addinterfaces"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- Just output the name of the header and source filenames for this interface. -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="$iface" mode="listfile">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="file" select="concat(substring(@name, 2), 'Wrap.h')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="$iface" mode="listfile">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="file" select="concat(substring(@name, 2), 'Wrap.cpp')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="public">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="substring($gluetype,string-length($gluetype))!='*'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="wrapped">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="safearray" select="../@safearray"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:when test="substring($wraptype,string-length($wraptype))='&'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="substring($wraptype,1,string-length($wraptype)-2)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:when test="substring($wraptype2,string-length($wraptype2))='>'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:when test="substring($wraptype,string-length($wraptype))='>'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="substring($wraptype,string-length($wraptype))!='&'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="substring($wraptype,string-length($wraptype))!='*'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="logparamtext">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$isref!='yes' and ($dir='out' or $dir='ret')">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="safearray" select="../@safearray"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="logparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:when test="../@safearray='yes' and $isref!='yes'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:when test="../@safearray='yes' and $isref!='yes'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="dtraceparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- Later:
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat($tmpname, '.array().data(), ')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:text>.uuid().toStringCurly().c_str()</xsl:text>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- Same as dtraceparamval except no temporary variables are used (they are out of scope). -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="dtraceparamvalnotmp">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<xsl:template match="attribute/@type | param/@type" mode="dtraceparamdecl">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <!-- Safe arrays get an extra size parameter. -->
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:if test="substring($gluetype,string-length($gluetype))!='*'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- Call this to determine whether a temporary conversion variable is used for the current parameter.
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsyncReturns empty if not needed, non-empty ('yes') if needed. -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:when test="$type = 'wstring' or $type = '$unknown' or $type = 'uuid' or ../@safearray = 'yes'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- Micro optimizations: Postpone calculating $thatif. -->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync<!-- Call this to get the argument conversion class, if any is needed. -->
45a24008fece0d2b499202e004c982f3a430651cvboxsync <xsl:text>ComTypeInConverter<IUnknown></xsl:text>
45a24008fece0d2b499202e004c982f3a430651cvboxsync <xsl:text>ComTypeOutConverter<IUnknown></xsl:text>
45a24008fece0d2b499202e004c982f3a430651cvboxsync <!-- Micro optimizations: Delay calculating thatif. -->
45a24008fece0d2b499202e004c982f3a430651cvboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:variable name="thatifname" select="$thatif/@name"/>
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:value-of select="concat('<', $thatifname, '>')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('<', $gluetype, '>')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- Emits code for converting the parameter to a temporary variable. -->
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync<xsl:template match="attribute/@type | param/@type" mode="paramvalconversion2tmpvar">
45a24008fece0d2b499202e004c982f3a430651cvboxsync<!-- Partner to paramvalconversion2tmpvar that emits the parameter when calling call the internal worker method. -->
45a24008fece0d2b499202e004c982f3a430651cvboxsync<xsl:template match="attribute/@type | param/@type" mode="paramvalconversionusingtmp">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="thatif" select="//interface[@name=$type]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- Make sure BOOL values we pass down are either TRUE or FALSE. -->
681bb0bf6e9ab5a590d8afcdf37634e2fc29f595vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync emit attribute
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' STDMETHOD(COMGETTER(', $attrbasename, '))(')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat(' STDMETHOD(COMSETTER(', $attrbasename, '))(')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat(' virtual HRESULT get', $attrbasename, '(')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:with-param name="option" select="'passcaller'"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="wrapped">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat(' virtual HRESULT set', $attrbasename, '(')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="wrapped">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="option" select="'limitedcaller'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('STDMETHODIMP ', $topclass, 'Wrap::COMGETTER(', $attrbasename, ')(')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="logparamtext">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('"', $topclass, '::get', $attrbasename, '", ')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="logparamval">
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync VirtualBoxBase::clearError();
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync HRESULT hrc;
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:apply-templates select="@type" mode="paramvalconversion2tmpvar">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$attrbasename != 'MidlDoesNotLikEmptyInterfaces'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_ENTER('), $G_lowerCase, $G_upperCase)"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync if (FAILED(autoCaller.rc()))
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat(' hrc = get', $attrbasename, '(')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="option" select="'passcaller'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="paramvalconversionusingtmp">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$attrbasename != 'MidlDoesNotLikEmptyInterfaces'">
45a24008fece0d2b499202e004c982f3a430651cvboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
45a24008fece0d2b499202e004c982f3a430651cvboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
45a24008fece0d2b499202e004c982f3a430651cvboxsync <xsl:apply-templates select="@type" mode="dtraceparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync catch (HRESULT hrc2)
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$attrbasename != 'MidlDoesNotLikEmptyInterfaces'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:text>this, hrc, 1 /*hrc exception*/,</xsl:text>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="dtraceparamvalnotmp">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync catch (...)
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);</xsl:text>
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync <xsl:if test="$attrbasename != 'MidlDoesNotLikEmptyInterfaces'">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_GET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:text>this, hrc, 9 /*unhandled exception*/,</xsl:text>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="dtraceparamvalnotmp">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="logparamtext">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('"', $topclass, '::get', $dtraceattrname, '", ')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="logparamval">
45a24008fece0d2b499202e004c982f3a430651cvboxsync return hrc;
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('STDMETHODIMP ', $topclass, 'Wrap::COMSETTER(', $attrbasename, ')(')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- @todo check in parameters if possible -->
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:apply-templates select="@type" mode="logparamtext">
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:value-of select="concat('"', $topclass, '::set', $attrbasename, '", ')"/>
9f3a515a29d45728a5c5330459abd3429e35bda1vboxsync <xsl:apply-templates select="@type" mode="logparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync VirtualBoxBase::clearError();
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync HRESULT hrc;
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="paramvalconversion2tmpvar">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $topclass, '_SET_', $dtraceattrname, '_ENTER('), $G_lowerCase, $G_upperCase)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="dtraceparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync if (FAILED(autoCaller.rc()))
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' hrc = set', $attrbasename, '(')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="paramvalconversionusingtmp">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_SET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="dtraceparamval">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync catch (HRESULT hrc2)
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync hrc = hrc2;
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_SET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:text>this, hrc, 1 /*hrc exception*/,</xsl:text>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="dtraceparamvalnotmp">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync catch (...)
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_SET_', $dtraceattrname, '_RETURN('), $G_lowerCase, $G_upperCase)"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:text>this, hrc, 9 /*unhandled exception*/,</xsl:text>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="dtraceparamvalnotmp">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync LogRelFlow(("{%p} %s: leave hrc=%Rhrc\n", this, </xsl:text>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat('"', $topclass, '::set', $attrbasename, '", ')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync return hrc;
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync Emit DTrace probes for the given attribute.
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync<xsl:template match="attribute" mode="dtrace-probes">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <!-- attrbasename -->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:if test="@name != 'midlDoesNotLikEmptyInterfaces'">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <!-- <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__enter(struct ', $topclass)"/> -->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__enter(void')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <!-- <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__return(struct ', $topclass, ' *a_pThis')"/> -->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat($dtracetopclass, '__get__', $dtraceattrname, '__return(void *a_pThis')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:text>, uint32_t a_hrc, int32_t enmWhy, </xsl:text>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="dtraceparamdecl">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:if test="(not(@readonly) or @readonly!='yes') and @name != 'midlDoesNotLikEmptyInterfaces'">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <!-- <xsl:value-of select="concat($topclass, '__set__', $dtraceattrname, '__enter(struct ', $topclass, ' *a_pThis, ')"/>-->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat($topclass, '__set__', $dtraceattrname, '__enter(void *a_pThis, ')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="dtraceparamdecl">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <!-- <xsl:value-of select="concat($dtracetopclass, '__set__', $dtraceattrname, '__return(struct ', $topclass, ' *a_pThis')"/> -->
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat($dtracetopclass, '__set__', $dtraceattrname, '__return(void *a_pThis')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:text>, uint32_t a_hrc, int32_t enmWhy, </xsl:text>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="@type" mode="dtraceparamdecl">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync emit all attributes of an interface
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- first recurse to emit all base interfaces -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="extends" select="$iface/@extends"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:if test="$extends and not($extends='$unknown') and not($extends='$errorinfo')">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="iface" select="//interface[@name=$extends]"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="topclass" select="$topclass"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('// ', $iface/@name, ' properties')"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:value-of select="concat($G_sNewLine, ' // ', $pmode, ' ', $iface/@name, ' properties', $G_sNewLine)"/>
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:apply-templates select="$iface/attribute | $iface/if" mode="public">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:with-param name="emitmode" select="'attribute'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="$iface/attribute | $iface/if" mode="wrapped">
2708eaa62821078ffc3eaef2d5ca7dd31c8e1ba7vboxsync <xsl:with-param name="emitmode" select="'attribute'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="$iface/attribute | $iface/if" mode="code">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="topclass" select="$topclass"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="emitmode" select="'attribute'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="$iface/attribute | $iface/if" mode="dtrace-probes">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="topclass" select="$topclass"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="dtracetopclass" select="$dtracetopclass"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="emitmode" select="'attribute'"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync<!-- - - - - - - - - - - - - - - - - - - - - - -
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync emit method
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync - - - - - - - - - - - - - - - - - - - - - - -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="option" select="'passcaller'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="wrapped">
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="str" select="concat($topclass, @name)"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
1000fd01b52f6f6b49e4bbaf57903c1bf637a8aevboxsync <xsl:with-param name="option" select="'limitedcaller'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:variable name="dtracenamehack"> <!-- Ugly hack to deal with Session::assignMachine and similar. -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat('STDMETHODIMP ', $topclass, 'Wrap::', $methodbasename, '(')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="logparamtext">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(', "', $topclass, '::', @name, '"')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="logparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync VirtualBoxBase::clearError();
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync HRESULT hrc;
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <!-- @todo check in parameters if possible -->
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:text> CheckComArgOutPointerValidThrow(a</xsl:text>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="paramvalconversion2tmpvar">
ec6ba6b64e8a0b6d09b24676d70d414e00c99ebbvboxsync#ifdef VBOX_WITH_DTRACE_R3_MAIN
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_ENTER('), $G_lowerCase, $G_upperCase)"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="dtraceparamval">
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync if (FAILED(autoCaller.rc()))
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:value-of select="concat(' hrc = ', @name, '(')"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="optionlist" select="@wrap-hint-server"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:with-param name="option" select="'passcaller'"/>
c0d22c23d3289cef0332f4d61ab15df48ed34979vboxsync <xsl:apply-templates select="@type" mode="paramvalconversionusingtmp">
<xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_RETURN('), $G_lowerCase, $G_upperCase)"/>
<xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_RETURN('), $G_lowerCase, $G_upperCase)"/>
<xsl:value-of select="translate(concat('VBOXAPI_', $dtracetopclass, '_', $dtracemethodname, substring($dtracenamehack, 2), '_RETURN('), $G_lowerCase, $G_upperCase)"/>
<xsl:variable name="dtracenamehack"> <!-- Ugly hack to deal with Session::assignMachine and similar. -->
<!-- <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__enter(struct ', $dtracetopclass, ' *a_pThis')"/> -->
<xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__enter(void *a_pThis')"/>
<!-- <xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, '__return(struct ', $dtracetopclass, ' *a_pThis')"/> -->
<xsl:value-of select="concat($dtracetopclass, '__', $dtracemethodname, $dtracenamehack, '__return(void *a_pThis')"/>
<xsl:value-of select="concat($G_sNewLine, ' // ', $pmode, ' ', $iface/@name, ' methods', $G_sNewLine)"/>
<!-- currently nothing, maybe later some generic FinalConstruct/... helper declaration for ComObjPtr -->
<!-- interface attributes/methods (public) -->
<!-- wrapped interface attributes/methods (private) -->
emit all attributes and methods definitions (pmode=code) or probes (pmode=dtrace-probes) of an interface
<xsl:value-of select="concat('DEFINE_EMPTY_CTOR_DTOR(', substring($iface/@name, 2), 'Wrap)', $G_sNewLine, $G_sNewLine)"/>
<!-- interface attributes/methods (public) -->
<!-- interface attributes/methods (public) -->