📄 create_an_organization_attribute_class.htm
字号:
<!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="HowTo:ACIS:Create an Organization Attribute Class,ACIS,Attributes" /> <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=HowTo:ACIS:Create_an_Organization_Attribute_Class&action=creativecommons" rel="meta" /> <title>HowTo:ACIS:Create an Organization Attribute Class - 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 = "HowTo";var wgCanonicalSpecialPageName = false;var wgNamespaceNumber = 102;var wgPageName = "HowTo:ACIS:Create_an_Organization_Attribute_Class";var wgTitle = "ACIS:Create an Organization Attribute Class";var wgAction = "view";var wgRestrictionEdit = ["sysop"];var wgRestrictionMove = ["sysop"];var wgArticleId = "434";var wgIsArticle = true;var wgUserName = null;var wgUserGroups = null;var wgUserLanguage = "en";var wgContentLanguage = "en";var wgBreakFrames = false;var wgCurRevisionId = "1201";/*]]>*/</script>
<script type="text/javascript" src="/r18/skins/common/wikibits.js?97"><!-- wikibits js --></script>
<script type="text/javascript" src="/r18/index.php?title=-&action=raw&gen=js&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><style type="text/css">/*<![CDATA[*/.source-cpp {line-height: normal;}.source-cpp li {line-height: normal;}/** * GeSHi Dynamically Generated Stylesheet * -------------------------------------- * Dynamically generated stylesheet for cpp * CSS class: source-cpp, CSS id: * GeSHi (C) 2004 - 2007 Nigel McNie (http://qbnz.com/highlighter) */.source-cpp .de1, .source-cpp .de2 {font-family: 'Courier New', Courier, monospace; font-weight: normal;}.source-cpp {}.source-cpp .head {}.source-cpp .foot {}.source-cpp .imp {font-weight: bold; color: red;}.source-cpp .ln-xtra {color: #cc0; background-color: #ffc;}.source-cpp li {font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;}.source-cpp li.li2 {font-weight: bold;}.source-cpp .kw1 {color: #0000ff;}.source-cpp .kw2 {color: #0000ff;}.source-cpp .kw3 {color: #0000dd;}.source-cpp .kw4 {color: #0000ff;}.source-cpp .kw5 {color: #000099;}.source-cpp .kw6 {color: #000099; font-weight:normal}.source-cpp .kw7 {color: #004D99;}.source-cpp .co1 {color: #006600; font-style: italic;}.source-cpp .co2 {color: #006600;}.source-cpp .coMULTI {color: #006600; font-style: italic;}.source-cpp .es0 {color: #666666; font-weight: bold;}.source-cpp .br0 {color: #B300D6;}.source-cpp .st0 {color: #999933;}.source-cpp .nu0 {color: #A30000;}.source-cpp .me1 {color: #993300;}.source-cpp .me2 {color: #993300;}@import "/r18/index.php?title=MediaWiki:Geshi.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";/*]]>*/</style> </head>
<body class="mediawiki ns-102 ltr page-HowTo_ACIS_Create_an_Organization_Attribute_Class">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<h1 class="firstHeading">HowTo:ACIS:Create an Organization Attribute Class</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>Each application developer must create an organization class from which to derive all application specific <a href="/r18/index.php?title=Attributes&action=edit" class="new" title="Attributes">attributes</a>. This class cannot be instantiated. Its purpose is to uniquely identify the owning development organization. This section provides an example of creating an organization attribute class by copying the .hxx and .cxx files that define an existing <a href="/r18/index.php?title=ACIS&action=edit" class="new" title="ACIS">ACIS</a> organization attribute class and modifying those files.</p><table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div><ul><li class="toclevel-1"><a href="#Header_File"><span class="tocnumber">1</span> <span class="toctext">Header File</span></a><ul><li class="toclevel-2"><a href="#C.2B.2B_Example"><span class="tocnumber">1.1</span> <span class="toctext">C++ Example</span></a></li><li class="toclevel-2"><a href="#C.2B.2B_Example_2"><span class="tocnumber">1.2</span> <span class="toctext">C++ Example</span></a></li></ul></li><li class="toclevel-1"><a href="#Implementation_File"><span class="tocnumber">2</span> <span class="toctext">Implementation File</span></a><ul><li class="toclevel-2"><a href="#C.2B.2B_Example_3"><span class="tocnumber">2.1</span> <span class="toctext">C++ Example</span></a></li><li class="toclevel-2"><a href="#C.2B.2B_Example_4"><span class="tocnumber">2.2</span> <span class="toctext">C++ Example</span></a></li></ul></li></ul></td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script><a name="Header_File"></a><h2> <span class="mw-headline"> Header File </span></h2><p>To create an organization attribute class header file:</p><ol><li> Name the attribute organization class ATTRIB_<<i>sentinel</i>> where <<i>sentinel</i>> is a unique two or three letter code obtained from Spatials customer support department. In this example, the sentinel ABC is used.</li><li> Copy the at_tsl.hxx file (the header file for the ATTRIB_TSL class) from the ACIS installation directory and rename it at_abc.hxx.</li><li> Change the copied file as shown in the following example. Replace all the bold names in the file (<b>tsl</b> or <b>TSL</b>) with the new organization classs sentinel. In this example, the sentinel ABC (shown in bold italics as <i><b>abc</b></i> or <i><b>ABC</b></i>) is used.</li></ol><blockquote class="templatequote"><div><p><i><b>Note:</b> In this example, the organization attribute class is defined in the KERN module (where ATTRIB_TSL is defined. To define a class in a different module, additional changes to the file would be needed.</i></p></div></blockquote><p>The following example of the attribute header file shows the sentinels that are to be replaced in <b>bold</b> font. In the new file, the new sentinel is shown in<i> <b>bold italic</b></i> font.</p><a name="C.2B.2B_Example"></a><h3> <span class="mw-headline"> C++ Example </span></h3><pre class="source-cpp"><span class="co1">// Attribute declaration for a private container attribute. Each</span><span class="co1">// application developer receives one of these customized for</span><span class="co1">// their use.</span><span class="co1">// All attributes specific to the application developer are then</span><span class="co1">// made derived classes of this attribute, ensuring that</span><span class="co1">// different developers can assign identifiers independently</span><span class="co1">// without mutual interference.</span><span class="kw2">#if</span> !defined<span class="br0">(</span><span class="kw7">ATTRIB_TSL_CLASS</span><span class="br0">)</span><span class="kw2">#define</span> <span class="kw7">ATTRIB_TSL_CLASS</span><span class="kw2">#include</span> dcl_kern.<span class="me1">h</span><span class="kw2">#include</span> attrib.<span class="me1">hxx</span><span class="kw4">extern</span> <span class="kw7">DECL_KERN</span> <span class="kw4">int</span> ATTRIB_TSL_TYPE;<span class="kw2">#define</span> <span class="kw7">ATTRIB_TSL_LEVEL</span> <span class="br0">(</span><span class="kw7">ATTRIB_LEVEL</span> + <span class="nu0">1</span><span class="br0">)</span><span class="kw7">MASTER_ATTRIB_DECL</span><span class="br0">(</span> <span class="kw7">ATTRIB_TSL</span>, KERN <span class="br0">)</span><span class="kw2">#endif</span></pre><p>Example. Original at_tsl.hxx</p><p>After customizing at_tsl.hxx into at_abc.hxx, the organization class file should appear similar to the following example.</p><a name="C.2B.2B_Example_2"></a><h3> <span class="mw-headline"> C++ Example </span></h3><pre class="source-cpp"><span class="kw2">#if</span> !defined<span class="br0">(</span>ATTRIB_ABC_CLASS<span class="br0">)</span><span class="kw2">#define</span> ATTRIB_ABC_CLASS<span class="kw2">#include</span> dcl_kern.<span class="me1">h</span><span class="kw2">#include</span> attrib.<span class="me1">hxx</span><span class="kw4">extern</span> <span class="kw4">int</span> ATTRIB_ABC_TYPE;<span class="kw2">#define</span> ATTRIB_ABC_LEVEL <span class="br0">(</span><span class="kw7">ATTRIB_LEVEL</span> + <span class="nu0">1</span><span class="br0">)</span><span class="kw7">MASTER_ATTRIB_DECL</span><span class="br0">(</span> ATTRIB_ABC, NONE <span class="br0">)</span><span class="kw2">#endif</span></pre><p>Example. Customized at_abc.hxx</p><p>Macro MASTER_ATTR_DECL completes the file. The first argument is the new organization attribute class name; the second is the module name. If creating an attribute that is not meant for export, use "NONE" as the module name.</p><a name="Implementation_File"></a><h2> <span class="mw-headline"> Implementation File </span></h2><p>To create an organization attribute class .cxx implementation file:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -