Rules and Standards |
CAA V5 Automation Documentation RulesHints and tips to tag and write comments in your IDL files |
Technical article |
AbstractThis article gives you information on how you can document your IDL interface header files using specific comments that are processed to build html files. |
Each of the following entity declared as L1 must be documented.
This applies to L1 entities that are located in the PublicInterfaces directories of the exposed frameworks.
[Top]
Interfaces and all the stuff they include, are documented thanks to information enclosed into specific comments inserted in the idl files. The idl statements and the comments are then processed to produce an organized set of html files in which you and the users of your interfaces can navigate. These comments are as follows:
/** * This is a comment. */ |
They must begin by /**
and end by */
. Each
intermediate line must begin by a leading *
.
Never use such a comment for any other purpose than documentation, otherwise
your internal comments will be processed and clearly readable, and moreover may
pollute automatically generated lists and index.
A comment must be placed just before the line containing the declaration of the interface, method, etc., it is intended to describe.
/** * Represents the document. * The document is the object handled by the operating system as a whole * that stores your data in files and databases. * It is assigned a type determined by its contents. It may contain other * documents with a different type. For example, * a PartDocument contains a part and can be contained in a ProductDocument. * A workshop is associated with a document to gather all the commands * that can be used to create, modify, and edit the objects making up the * the document. These commands are arranged in menus and toolbars. * @see CATIAPartDocument, CATIAProductDocument, CATIADrawingDocument */ interface CATIADocument : CATIABase ... |
[Top]
[Top]
You will find below some tips to write comments for interfaces, methods, properties, collections, and enumerations.
[Top]
Do:
Don't:
IDL File | html File |
---|---|
CATIAApplication.idl | Application.htm |
[Top]
Do:
Begin an argument definition using the definite article The. For example, write The point coordinates, or The dialog agent. You can use A instead of The if there is a part of indetermination, such as An object of the collection.
Don't:
IDL File | html File | |
---|---|---|
Sub.idl | Sub.htm | Shows a Sub |
Func.idl | Func.htm | Shows a Func |
[Top]
Do:
Don't:
Refer to the following examples:
IDL File | html File | |
---|---|---|
ActiveViewer.idl | ActiveViewer.htm | Read only property |
WindowState.idl | WindowState.htm | Read/write property |
[Top]
Do:
Don't:
Refer to the following examples:
IDL File | html File | |
---|---|---|
CATIACameras.idl | Cameras.htm | Collection with Item and Remove methods |
CATIALightSources.idl | LightSources.htm | Collection with Add, Item, and Remove methods |
[Top]
Do:
Don't:
Refer to the following example:
IDL File | html File |
---|---|
CatNavigationStyle.idl | CatNavigationStyle.htm |
[Top]
Some specific tags are used to denote specific entities and generate html tags to present this information consistently. These tags begin with the "at" sign, or @. These tags are:
Tag | Definition |
---|---|
@nodoc | To denote each entity that you don't want to see in the extracted html file |
@param | To denote each method or global function parameter, enum value, struct member, and possibly typedef value |
@see | To create a See also section that contains hyperlinks to other documented entities, usually located at the end of the role of a class or method |
@href | To create a hyperlink to other documented entities anywhere in the text |
@return | To create a Returns section to describe the returned value of a method |
[Top]
To denote each entity that you don't want to see in the extracted html file.
/** * @nodoc */ #pragma PROPERTY Windows HRESULT get_Windows(out /*IDLRETVAL*/ CATIAWindows oWindows); /** @nodoc */ #pragma PROPERTY Windows HRESULT get_Windows(out /*IDLRETVAL*/ CATIAWindows oWindows); /** * @nodoc * Returns the collection of windows currently managed by the application. * <dl> * <dt><b>Example:</b> * <dd> * This example retrieves in <tt>WinCollection</tt> the collection of * windows currently managed by the <tt>CATIA</tt> application. * <pre> * Dim WinCollection As Windows * Set WinCollection = CATIA.<font color="red">Windows</font> * </pre> * </dl> */ #pragma PROPERTY Windows HRESULT get_Windows(out /*IDLRETVAL*/ CATIAWindows oWindows);
[Top]
To denote each sub or func parameter, except the parameter returned as an IDLRETVAL.
/** * Sets the origin point which the hole is anchored to.<br> * If mandatory, the entry point will be projected onto a tangent plane. * @param iX * Origin point x absolute coordinate * @param iY * Origin point y absolute coordinate * @param iZ * Origin point z absolute coordinate * <dl> * <dt><b>Example:</b> * <dd>The following example sets the coordinates of * hole <tt>firstHole</tt> to 10., 20., -5. : * <pre> * firstHole.<font color="red">SetOrigin</font> 10., 20., 5. *</pre> * </dl> */ HRESULT SetOrigin ( in double iX, in double iY, in double iZ );
[Top]
To create a See also section that contains hyperlinks to other documented entities, usually located at the end of the role of a class or method. Use the comma to separate two successive entity.
/** * Represents the document. * The document is the object handled by the operating system as a whole * that stores your data in files and databases. * It is assigned a type determined by its contents. It may contain other * documents with a different type. For example, * a PartDocument contains a part and can be contained in a ProductDocument. * A workshop is associated with a document to gather all the commands * that can be used to create, modify, and edit the objects making up the * the document. These commands are arranged in menus and toolbars. * @see CATIAPartDocument, CATIAProductDocument, CATIADrawingDocument */ interface CATIADocument : CATIABase
You can also refer to a method or property using @see
.
/** * ... * @see CATIADocuments#Add, CATIADocuments#Item */ interface CATIADocument : CATIABase
See Using Hyperlinks to know which hyperlinks you can use.
[Top]
To create a hyperlink to other documented entities anywhere in the text
/** * Represents the camera. * The camera is the object that stores a viewpoint saved from a viewer * at a given moment using the @href CATIAViewer#NewCamera method of * the @href CATIAViewer object. * The viewpoint stored in the camera can then be applied to another viewer * to display the document in this viewer according to this viewpoint. */ interface CATIACamera : CATIABase
Do not use @href
in the short role of any entity. Do not use
tags for monospace fonts (<tt>
or <code>
)
in hyperlinks. See Using Hyperlinks to know which
hyperlinks you can use.
[Top]
To create a Returns section to describe the value returned by a Func using IDLRETVAL.
/** * Returns a document using its index or its name from the documents * collection. * ... * @return * The retrieved document * ... */ HRESULT Item(in CATVariant iIndex, out /*IDLRETVAL*/ CATIADocument oDocument);
Use the Legal values named field whenever possible. If the returned value can take all the values of an enum, the hyperlink set by mkdcidl to the enum documentation can be enough. Nevertheless, if a only subset of these values can be returned, or if the meaning of is context-dependent, you must use the Legal values named field.
[Top]
Some comments may appear repeatitively, such as the parameter legal values. Use named fields to describe them. Available named fields are:
Named Field html Tags | Definition |
---|---|
<b>Role</b>: |
To describe the role of a class, an interface, a global function, an enum, a macro, a typedef |
<br><b>Role</b>: |
To describe the role of a method or data member |
<br><b>Precondition</b>: |
To describe the valid system context or state required before calling the method. Applies to methods |
<br><b>Postcondition</b>: |
To describe the system context or state that the method leaves or should leave when returning. Applies to methods |
<br><b>Legal values</b>: |
To describes parameter range of valid values, including the default value. Applies to method parameters |
[Top]
You can use html tags in your comments, except tags, such as <h1>, <h2>, as any other structuring tags. Main html tags you can use are:
Tag | Definition |
---|---|
<br> | To insert a line break |
<p> | To create a new paragraph |
<b>bold</b> | To enclose a text that should be rendered in boldface: bold |
<i>italic</i> | To enclose a text that should be rendered in italic font: italic |
<tt>monospace</tt> | To enclose a text that should be rendered in monospace font.
You can also use <code> and </code> .
Use these tags to enclose class names, method names, enum values, etc.
that you don't use as hyperlinks, that is that do not follow a <a
href="#see">see<a> or a <a
href="#href">href<a> tag |
<pre> and </pre> | To enclose lines that should be rendered with existing line breaks and using monospace font. It forces a line break |
<ul> and </ul> | To specify that the following block of text is a bulleted (or unordered) list. Each item begins with a <li> |
<ol> and </ol> | To specify that the following block of text is an ordered list. Each item begins with a <li> |
<dl> and </dl> | To specify that the following block of text is a definition list. Each defined term is denoted with <dt>, and each associated definition is denoted using <dd> |
[Top]
Hyperlink anchors are automatically generated on the following entities:
@see
or @href
,
such as in:
... @href CATIAApplication ... ... @see CATIAApplication
Note that the htm suffix must not be used.
Use @href CATIAApplication#Documents to retrieve the document collection associated with the application.
that sets the same hyperlinks as:
<a href="../InfInterfaces/CATIAApplication.htm#Documents">CATIAApplication.Documents</a>
which reads in the html file as follows:
Use CATIAApplication.Documents to retrieve the document collection associated with the application.
Hyperlink syntax:
@see CATIAApplication
or @href CATIAApplication
sets an hyperlink to the interface CATIAApplication. It can only be used
from any entity that IS NOT a CATIAApplication member@see CATIAApplication#Documents
or @href
CATApplication#Documents
sets an hyperlink to the
CATIAApplication.Documents property. It can only be used from any entity
that IS NOT a CATIAApplication member@see #Documents
or @href #Documents
sets an
hyperlink to the Documents property. It can only be used from any
entity that IS a CATIAApplication member.[Top]
Run mkdcidl for the IDL interfaces and enum of your framework. If you have
interfaces in ProtectedInterfaces, run mkdcidl -protected
When mkdcidl runs, errors are issued as lines beginning with #
mkdcidl-ERROR
and a short explanation of the error found.
html files are generated in the Doc\generated\interfaces directory located in your workspace root directory. Doc is at the same level than your framework directories.
![]() |
interfaces contains:
|
You cannot run mkdcidl for a single interface or framework. It applies to the whole workspace, but it's fast.
[Top]
Copyright © 2000, Dassault Systèmes. All rights reserved.