chapter_2_section_9.html   [plain text]


<html>
    <head>
        <META NAME="Generator" CONTENT="Gutenberg">
		<META NAME="GeneratorVersion" CONTENT="v100.1">
        <META http-equiv="content-type" CONTENT="text/html;charset=iso-8859-1">
        <META NAME = "Copyright" CONTENT="Copyright 2004 Apple Computer, Inc. All Rights Reserved.">
        <TITLE>Tools: HeaderDoc Unfettered: C Pseudoclass Tags</TITLE>
        <base target="content">

        <LINK REL="stylesheet" TYPE="text/css" HREF="../Resources/CSS/frameset_styles.css">
        <style type="text/css"></style>
        <script language="JavaScript" src="../Resources/JavaScript/page.js"></script>
    </head>
    
    <BODY bgcolor="#ffffff" onload="initialize_page();"><a name="//apple_ref/doc/uid/TP40001215-CH346-CIHDCIGC" title="C Pseudoclass Tags" turn_anchor="no"></a>
        <a name="top"></a>
        <!-- start of header -->
        <!--#include virtual="/includes/framesetheader" -->
        <!-- end of header -->
        
        <!-- start of path -->
<div class="breadcrumb"><a href="http://developer.apple.com/" target="_top">ADC Home</a> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000943"  -->Reference Library<!--/a--> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000440"  -->Documentation<!--/a--> &gt; <!--a logicalPath="//apple_ref/doc/uid/TP30000436"  -->Tools<!--/a--> &gt; <a logicalPath="//apple_ref/doc/uid/TP40001215-CH345" href="../intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP40001215-CH345">HeaderDoc Unfettered</a> &gt; <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346" href="chapter_2_section_1.html#//apple_ref/doc/uid/TP40001215-CH346">HeaderDoc Tags</a> &gt; </div><br>
<!-- end of path -->
        
        <table width="100%" cellpadding=0 cellspacing=0 border=0 class="mini_nav_text"><tr>
        <td align=left scope="row">

        <!-- insert Show/Hide frames -->
        <script type="text/javascript" language="JavaScript"><!--
  
        if (self != top) {
            // loaded in frames
            document.write('<a href="'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="'+self.location+'" target="_top">Hide TOC</a>');
        }
        else {
            // not loaded frames
            document.write('<a href="../index.html?'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="../index.html?'+self.location+'" target="_top">Show TOC</a>');
        }
        //--></script>
        <!-- end Show/Hide frames -->

        </td><td align=right>
        
        <a href="chapter_2_section_8.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_2_section_10.html" target="_self">Next Page &gt;</a></span>
        
        </td>
        </tr></table>
        
        <hr>
        
        <a name="CIHDCIGC" title="C Pseudoclass Tags" turn_anchor="no"></a><br><h2>C Pseudoclass Tags</h2>
<p>There are three tags provided for C pseudoclasses, such as
COM interfaces. The <tt>@class</tt> tag is
used for generic pseudoclasses. The <tt>@interface</tt> tag
is used for COM interfaces. The <tt>@superclass</tt> tag
can be added to an <tt>@class</tt> or <tt>@interface</tt> declaration
to modify its behavior.</p>



    <h4>In this section:</h4>

    
    
    
    <blockquote class="content_text">
        
            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1043" href="chapter_2_section_9.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1043">Class Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1044" href="chapter_2_section_9.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1044">Interface Tags</a>
            
        <br>

            <a logicalPath="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1045" href="chapter_2_section_9.html#//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1045">Superclass Tags</a>
            
        <br>

    </blockquote>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1043" title="
Class Tags" turn_anchor="no"></a><br><h3>
<tt>Class</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>	Tag				</p></b></div></th>
<th scope="col"><div align="left"><b><p>	Identifies	</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><tt>@class</tt>			</p></td>
<td class="content_text"><p>The name of the class.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 2-16 Example
of @class tag</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @class IOFireWireDeviceInterface_t</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> typedef struct IOFireWireDeviceInterface_t</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>{</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>    IUNKNOWN_C_GUTS;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>}</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p>The <tt>@class</tt> tag
causes the <tt>typedef struct</tt>	that
follows the HeaderDoc comment to be treated as a class. This is
a frequently-used technique in kernel programming. A slight variation
of this tag, <tt>@interface</tt>,
is provided for COM interfaces so that they can be identified as
such in the TOC.</p>
<p>You should mark up any C pseudoclasses in the same way you
would mark up a C++ class. Apart from the unusual form of function
declarations (in the form of function pointers), the resulting output
should be similar to that of a C++ class.</p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1044" title="Interface
Tags" turn_anchor="no"></a><br><h3>Interface
Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>	Tag				</p></b></div></th>
<th scope="col"><div align="left"><b><p>	Identifies	</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><tt>@interface</tt></p></td>
<td class="content_text"><p>The name of a COM interface.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 2-17 Example
of @interface tag</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @interface IOFireWireDeviceInterface_t</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> typedef struct IOFireWireDeviceInterface_t</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>{</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>    IUNKNOWN_C_GUTS;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>}</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p>The <tt>@class</tt> tag
causes the <tt>typedef struct</tt>	that
follows the headerdoc comment to be treated as a COM interface (which
is essentially a C pseudoclass with a different name).</p>
<p>You should mark up any C pseudoclasses in the same way you
would mark up a C++ class. Apart from the unusual form of function
declarations (in the form of function pointers), the resulting output
should be similar to that of a C++ class.</p>
<a name="//apple_ref/doc/uid/TP40001215-CH346-DontLinkElementID_1045" title="Superclass
Tags" turn_anchor="no"></a><br><h3>Superclass
Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<th scope="col"><div align="left"><b><p>	Tag				</p></b></div></th>
<th scope="col"><div align="left"><b><p>	Identifies	</p></b></div></th>
<th scope="col"><div align="left"><b><p>Fields</p></b></div></th>
</tr>



<tr>
<td class="content_text" scope="row"><p><tt>@superclass</tt></p></td>
<td class="content_text"><p>The name of the superclass.</p></td>
<td class="content_text"><p>	1 </p></td>
</tr>


</table><br>

<table><p><b><font face="lucida grande, geneva, helvetica, arial, sans-serif" size="2">Listing 2-18 Example
of @superclass tag</font></b></p>
<table cellpadding="8" width="100%" bgcolor="#F1F5F9" style="border: 1px solid #C9D1D7;"><tr><td scope="row"><table bgcolor="#F1F5F9" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><pre><code>/*! </code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @class IOFireWireDeviceInterface_t</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> @superclass IOFireWireDevice</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>*/</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code> typedef struct IOFireWireDeviceInterface_t</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>{</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>    IUNKNOWN_C_GUTS;</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>.</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code>}</code></pre></td><td><code><pre></pre></code></td></tr><tr><td scope="row"><pre><code></code></pre></td><td><code><pre></pre></code></td></tr></table></td></tr></table></table>
<p>The <tt>@superclass</tt> tag
can be used when you have a superclass-like relationship between two
C pseudoclasses or COM interfaces. Using this tag will cause the
documentation for the specified pseudo-superclass to be injected
into the documentation for the current pseudoclass.</p>
<p>The primary purpose for this feature is to reduce the amount
of bloat in headers, allowing you to document function pointers
in the top level pseudoclass and then only document the additional
function pointers in pseudoclasses that expand upon them.</p>
<p>Note that in order for this feature to work, both pseudoclasses
must be processed at the same time.</p>

        <br><br> 
        
        <table width="100%" cellpadding=0 cellspacing=0 border=0 class="mini_nav_text"><tr>
        <td align=left scope="row">

        <!-- insert Show/Hide frames -->
        <script type="text/javascript" language="JavaScript"><!--
           
        if (self != top) {
            // loaded in frames
            document.write('<a href="'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="'+self.location+'" target="_top">Hide TOC</a>');
        }
        else {
            // not loaded frames
            document.write('<a href="../index.html?'+self.location+'" target="_top"><img src="../Resources/Images/show_toc_icon.gif" width="15" height="14" border="0" style="margin-bottom: -2px;" alt=""></a> <a href="../index.html?'+self.location+'" target="_top">Show TOC</a>');
        }
        //--></script>
        <!-- end Show/Hide frames -->

        </td><td align=right>
        
        <a href="chapter_2_section_8.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_2_section_10.html" target="_self">Next Page &gt;</a></span>
        
        </td>
        </tr></table>

        <br><hr><p class="content_text"> <!--#if expr="0=1" -->&#169; 1999, 2004 Apple Computer, Inc. All Rights Reserved. (<!--#endif -->Last updated: 2004-05-27<!--#if expr="0=1" -->)<!--#endif --></p>

        
        <!-- start of footer -->
        <!--#include virtual="/includes/framesetfooter" -->
        <!-- end of footer -->
    </BODY>
</html>