⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attribute_derivation_macros.htm

📁 acis说明文档
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<meta name="keywords" content="Attribute Derivation Macros,Functions,Debug file,Debugging,Attributes,Classes,Entities,Entity Derivation Macros,Entity" />		<link rel="shortcut icon" href="/favicon.ico" />		<link rel="search" type="application/opensearchdescription+xml" href="/r18/opensearch_desc.php" title="DocR18 (English)" />		<link title="Creative Commons" type="application/rdf+xml" href="/r18/index.php?title=Attribute_Derivation_Macros&amp;action=creativecommons" rel="meta" />		<title>Attribute Derivation Macros - DocR18</title>
		<style type="text/css" media="screen, projection">/*<![CDATA[*/
			@import "/r18/skins/common/shared.css?97";
			@import "/r18/skins/monobook/main.css?97";
		/*]]>*/</style>
		<link rel="stylesheet" type="text/css" media="print" href="/r18/skins/common/commonPrint.css?97" />
		<!--[if lt IE 5.5000]><style type="text/css">@import "/r18/skins/monobook/IE50Fixes.css?97";</style><![endif]-->
		<!--[if IE 5.5000]><style type="text/css">@import "/r18/skins/monobook/IE55Fixes.css?97";</style><![endif]-->
		<!--[if IE 6]><style type="text/css">@import "/r18/skins/monobook/IE60Fixes.css?97";</style><![endif]-->
		<!--[if IE 7]><style type="text/css">@import "/r18/skins/monobook/IE70Fixes.css?97";</style><![endif]-->
		<!--[if lt IE 7]><script type="text/javascript" src="/r18/skins/common/IEFixes.js?97"></script>
		<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
		
		<script type= "text/javascript">/*<![CDATA[*/var skin = "monobook";var stylepath = "/r18/skins";var wgArticlePath = "/r18/index.php/$1";var wgScriptPath = "/r18";var wgScript = "/r18/index.php";var wgServer = "http://doc.spatial.com";var wgCanonicalNamespace = "";var wgCanonicalSpecialPageName = false;var wgNamespaceNumber = 0;var wgPageName = "Attribute_Derivation_Macros";var wgTitle = "Attribute Derivation Macros";var wgAction = "view";var wgRestrictionEdit = ["sysop"];var wgRestrictionMove = ["sysop"];var wgArticleId = "439";var wgIsArticle = true;var wgUserName = null;var wgUserGroups = null;var wgUserLanguage = "en";var wgContentLanguage = "en";var wgBreakFrames = false;var wgCurRevisionId = "1150";/*]]>*/</script>                
		<script type="text/javascript" src="/r18/skins/common/wikibits.js?97"><!-- wikibits js --></script>
		<script type="text/javascript" src="/r18/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=monobook"><!-- site js --></script>
		<style type="text/css">/*<![CDATA[*/@import "/r18/index.php?title=MediaWiki:Common.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";@import "/r18/index.php?title=MediaWiki:Monobook.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";@import "/r18/index.php?title=-&action=raw&gen=css&maxage=18000";/*]]>*/</style>
		<!-- Head Scripts -->
		<script type="text/javascript" src="/r18/skins/common/ajax.js?97"></script>	</head>
<body  class="mediawiki ns-0 ltr page-Attribute_Derivation_Macros">
	<div id="globalWrapper">
		<div id="column-content">
	<div id="content">
		<a name="top" id="top"></a>
				<h1 class="firstHeading">Attribute Derivation Macros</h1>
		<div id="bodyContent">
			<h3 id="siteSub">From DocR18</h3>
			<div id="contentSub"></div>
									<div id="jump-to-nav">Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div>			<!-- start content -->
			<p>This section describes some of the macros used to facilitate the definition of new <a href="/r18/index.php?title=Attributes&amp;action=edit" class="new" title="Attributes">ATTRIBUTE</a> classes; they are illustrated in examples. These macros are defined in file <tt>at_macro.hxx</tt>. Because attributes are derived from <a href="/r18/index.php?title=Entities&amp;action=edit" class="new" title="Entities">entities</a>, attribute macros are very similar to the entity macros defined in <tt>entity.hxx</tt>. For more information, refer to the section on <a href="/r18/index.php?title=Entity_Derivation_Macros&amp;action=edit" class="new" title="Entity Derivation Macros">Entity Derivation Macros</a>.</p><a name="User-Defined_Attribute_Macros"></a><h2> <span class="mw-headline"> User-Defined Attribute Macros </span></h2><p>Developers must define the following macros to use the predefined attribute macros.</p><ul><li> <tt><b>THIS()</b></tt> - The name of this class being defined</li><li> <tt><b>PARENT()</b></tt> - The name of the immediate base class (parent)</li><li> <tt><b>THIS_LIB</b></tt> - The name of the module (library) in which this class is implemented</li><li> <tt><b>PARENT_LIB</b></tt> - The name of the module (library) in which the immediate base class (parent) is implemented</li><li> <tt><b>&lt;<i>class</i>&gt;_NAME</b></tt> - The <a href="/r18/index.php?title=Entity&amp;action=edit" class="new" title="Entity">entity</a>'s external identifier (<tt>&lt;<i>class</i>&gt;</tt> is the class name)</li></ul><p>You must define <tt>THIS()</tt> and <tt>PARENT()</tt> with empty parentheses and  <tt>THIS_LIB</tt> and <tt>PARENT_LIB</tt> without parentheses. A string must be provided for <tt>&lt;<i>class</i>&gt;_NAME</tt>.</p><a name="Predefined_Attribute_Macros"></a><h2> <span class="mw-headline"> Predefined Attribute Macros </span></h2><p>The predefined attribute macros perform definitions and tasks common to all derived attribute <a href="/r18/index.php?title=Classes&amp;action=edit" class="new" title="Classes">classes</a>. Each attribute class has many methods. Because most of the methods are common to all attribute classes, macros simplify the definition of these methods.</p><p>The following macros are used for constructing an applications master attribute. This is the sentinel level organization attribute class that is constructed entirely by the macros:</p><ul><li> <tt><b>MASTER_ATTRIB_DECL</b></tt> - Declares an master (organization) attribute class, which has no data or methods of its own. This macro includes the macros defined by the ATTRIB_FUNCTIONS macro.</li><li> <tt><b>MASTER_ATTRIB_DEFN</b></tt> - Generates all the code necessary to define a master (organization) attribute class.</li></ul><p>The following attribute macro should be invoked in the header file for declaring a derived specific attribute:</p><ul><li> <tt><b>ATTRIB_FUNCTIONS</b></tt> - Declares common utility routines (including ENTITY methods inherited by ATTRIB).</li></ul><p>The following attribute macros should be invoked in the implementation file for defining a derived specific attribute. The macros should appear in this order.</p><ul><li> <tt><b>ATTRIB_DEF</b></tt> - This is a heading macro that combines four macros (ATTCOPY_DEF, LOSE_DEF, DTOR_DEF, DEBUG_DEF) in sequence, for the common case of <a href="/r18/index.php?title=Attributes&amp;action=edit" class="new" title="Attributes">attributes</a> that do not need any special action in the destructor or in duplication. If special handling is needed, the individual macros should be invoked instead of ATTRIB_DEF.</li><li> <tt><b>SAVE_DEF</b></tt> - Completes the debug_ent method and begins the save_common method. Place actions that write out specific attribute information to the save file and insert any pointers into the list immediately following this macro.</li><li> <tt><b>RESTORE_DEF</b></tt> - Completes the save_common method and begins the restore_common method. Place actions that read in specific attribute information from the save file immediately following this macro.</li><li> <tt><b>COPY_DEF</b></tt> - Completes the restore_common method and begins the copy_common method. Place actions that copy data items into the new object, using the input <i>list</i> to convert any pointers to indices immediately following this macro call.</li><li> <tt><b>SCAN_DEF</b></tt> - Completes the restore_common and begins the copy_scan method, which is used in many places in the system to gather a list of connected entities. The SCAN_TYPE <i>reason</i> may indicate the type of scan being performed. Depending on the <i>reason</i>, your implementation should insert any pointers into the input <i>list</i> immediately following this macro.</li><li> <tt><b>FIX_POINTER_DEF</b></tt> - Completes the copy_scan method and begins the fix_common method. The fix_common method is often called during two circumstances:<ul><li> during the final stage of restore, and</li><li> during the final stage of a copy (like api_copy_entity).</li></ul></li></ul><p>Use this method to map indices from the given <i>array</i> of entities to actual pointer values.</p><ul><li> <tt><b>TERMINATE_DEF</b></tt> - Terminates the definitions supplied by the *_DEF macros.</li></ul><p>In the case of attributes that need special handling in the destructor or in duplication, the following macros should be used (in this order) instead of ATTRIB_DEF: </p><ul><li> <tt><b>ATTCOPY_DEF</b></tt> - Invokes the UTILITY_DEF macro, which provides stock definitions for several required ENTITY <a href="/r18/index.php?title=Functions&amp;action=edit" class="new" title="Functions">functions</a> and static data for the restore function and dynamic virtual functions.<dl><dd> This macro then starts the definition of the fixup_copy method. Immediately following the ATTCOPY_DEF macro, place any special action required to duplicate the attribute for roll back purposes. The attribute itself has been copied member wise, but if there is a subsidiary structure hanging off a simple pointer (a character string hanging off a char pointer, for example) it requires copying or otherwise processing here.</dd><dd> ATTCOPY_DEF is used like ATTRIB_DEF, but must be followed by LOSE_DEF, DTOR_DEF, and DEBUG_DEF (in that order).</dd></dl></li></ul><ul><li> <tt><b>LOSE_DEF</b></tt> - Defines this attributes lose method. Place any special actions required to lose any dependent entities immediately following this macro.</li></ul><ul><li> <tt><b>DTOR_DEF</b></tt> - Defines the attributes destructor, which is called to permanently release all memory back to the operating system. Place any special actions required during attribute destruction immediately following this macro call. For example, a subsidiary data structure may need to be deleted.</li></ul>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -