Added code to the C# entity transform to help with memory-leak debugging - this gets compiled in only if using #if DEBUG is used when compiling the C#
This commit is contained in:
parent
bfd1f519db
commit
6ff5d773fa
|
@ -8,8 +8,8 @@
|
||||||
Transform ADL into C# entity classes
|
Transform ADL into C# entity classes
|
||||||
|
|
||||||
$Author: sb $
|
$Author: sb $
|
||||||
$Revision: 1.14 $
|
$Revision: 1.15 $
|
||||||
$Date: 2008-10-02 10:52:40 $
|
$Date: 2009-01-12 10:51:40 $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
<!-- WARNING WARNING WARNING: Do NOT reformat this file!
|
||||||
|
@ -66,7 +66,7 @@
|
||||||
// (c)2007 Cygnet Solutions Ltd
|
// (c)2007 Cygnet Solutions Ltd
|
||||||
//
|
//
|
||||||
// Automatically generated from application description using
|
// Automatically generated from application description using
|
||||||
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.14 $', 10)"/>
|
// adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.15 $', 10)"/>
|
||||||
//
|
//
|
||||||
// <xsl:value-of select="/adl:application/@revision"/>
|
// <xsl:value-of select="/adl:application/@revision"/>
|
||||||
//
|
//
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Automatically generated from description of entity <xsl:value-of select="@name"/>
|
/// Automatically generated from description of entity <xsl:value-of select="@name"/>
|
||||||
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.14 $', 10)"/>.
|
/// using adl2entityclass.xsl revision <xsl:value-of select="substring( '$Revision: 1.15 $', 10)"/>.
|
||||||
/// Note that manually maintained parts of this class may be defined in
|
/// Note that manually maintained parts of this class may be defined in
|
||||||
/// a separate file called <xsl:value-of select="@name"/>.manual.cs, q.v.
|
/// a separate file called <xsl:value-of select="@name"/>.manual.cs, q.v.
|
||||||
///
|
///
|
||||||
|
@ -100,14 +100,33 @@
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public partial class <xsl:value-of select="@name"/> : Entity
|
public partial class <xsl:value-of select="@name"/> : Entity
|
||||||
{
|
{
|
||||||
|
#if DEBUG
|
||||||
|
/// <summary>
|
||||||
|
/// while debugging, keep track of the number of live instances
|
||||||
|
/// </summary>
|
||||||
|
public volatile static int instances = 0;
|
||||||
|
#endif
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Auto-generated no-args constructor; does nothing (but probably should
|
/// Auto-generated no-args constructor; does nothing (but probably should
|
||||||
/// ensure ID slot is initialised correctly)
|
/// ensure ID slot is initialised correctly)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public <xsl:value-of select="@name"/>() : base(){
|
public <xsl:value-of select="@name"/>() : base(){
|
||||||
<xsl:call-template name="initialise-lists"/>
|
<xsl:call-template name="initialise-lists"/>
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
/* while debugging, keep track of the number of live instances; increment on creation */
|
||||||
|
instances ++;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
/// <summary>
|
||||||
|
/// while debugging, keep track of the number of live instances; decrement on deletion
|
||||||
|
/// </summary>
|
||||||
|
<xsl:value-of select="concat( '~', @name)"/>() {
|
||||||
|
instances --;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@natural-key">
|
<xsl:when test="@natural-key">
|
||||||
|
|
Loading…
Reference in a new issue