chapter_3_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>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="Unknown"  -->Technology TBD<!--/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_3_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_3_section_8.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_3_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 <b>@class</b> tag is used for generic
pseudoclasses. The <b>@interface</b> tag is used for
COM interfaces. The <b>@superclass</b> tag can be added
to an <b>@class</b> or <b>@interface</b> declaration
to modify its behavior.</p>



    <h4>In this section:</h4>

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

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

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

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

<tr>
<td class="content_text" scope="row"><p>	<b>Tag</b>				</p></td>
<td class="content_text"><p>	<b>Identifies</b>	</p></td>
<td class="content_text"><p><b>Fields</b></p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@class</b>			</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 3-12 @class
Example</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 <b>@class</b> 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, <b>@interface</b>,
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 as
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_868" title="
Interface Tags" turn_anchor="no"></a><br><h3>
<tt>Interface</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<td class="content_text" scope="row"><p>	<b>Tag</b>				</p></td>
<td class="content_text"><p>	<b>Identifies</b>	</p></td>
<td class="content_text"><p><b>Fields</b></p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@interface</b></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 3-13 @class
Example</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 <b>@class</b> tag causes the <tt>typedef
struct</tt>	that follows the headerdoc comment
to be treated as a COM interface (essentially a C pseudoclass with
a different name).</p>
<p>You should mark up any C pseudoclasses in the same way as
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_869" title="
Superclass Tags" turn_anchor="no"></a><br><h3>
<tt>Superclass</tt> Tags</h3>
<p></p><br><table border = "1" cellpadding = "3">

<tr>
<td class="content_text" scope="row"><p>	<b>Tag</b>				</p></td>
<td class="content_text"><p>	<b>Identifies</b>	</p></td>
<td class="content_text"><p><b>Fields</b></p></td>
</tr>

<tr>
<td class="content_text" scope="row"><p><b>@superclass</b></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 3-14 @class
Example</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 <b>@superclass</b> 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_3_section_8.html" target="_self">&lt; Previous Page</a><span style="margin-left: 8px"><a href="chapter_3_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>