📄 interrupting_acis_operations.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="Interrupting ACIS Operations" /> <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=Interrupting_ACIS_Operations&action=creativecommons" rel="meta" /> <title>Interrupting ACIS Operations - 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 = "Interrupting_ACIS_Operations";var wgTitle = "Interrupting ACIS Operations";var wgAction = "view";var wgRestrictionEdit = ["sysop"];var wgRestrictionMove = ["sysop"];var wgArticleId = "450";var wgIsArticle = true;var wgUserName = null;var wgUserGroups = null;var wgUserLanguage = "en";var wgContentLanguage = "en";var wgBreakFrames = false;var wgCurRevisionId = "1103";/*]]>*/</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-0 ltr page-Interrupting_ACIS_Operations">
<div id="globalWrapper">
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<h1 class="firstHeading">Interrupting ACIS Operations</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>Installing an interrupt checker with the set_acis_interrupt_checker function allows the application to gracefully interrupt the current ACIS operations and regain control of the process. This is a useful feature when applications want to be responsive to end-user input, such as responding to Ctrl+C input during lengthy operations. This function allows user to install a callback function that is frequently called from various places within ACIS code so that application side events can be evaluated. The callback function receives an informative string, which describes the current function in ACIS. Based on the user request, the callback function can do one of the following:</p><ul><li> call the <tt>interrupt_acis function</tt>, which will interrupt the process in a synchronous manner (preferred)</li><li> call the sys_error function with the <tt>SIGINT_FAULT</tt> argument, which will interrupt the operation asynchronously (immediately)</li><li> application can simply return from the callback, which allows the operation to continue</li></ul><p>This section contains snippets of C++ code to illustrate how to interrupt ACIS operations by defining and installing a callback function. These snippets are designed to be very simple starting points for developing your own code - they are not complete, compiling and runtime programs.</p><a name="Sample_Code"></a><h2> <span class="mw-headline"> Sample Code </span></h2><pre class="source-cpp"><span class="co1">// define the callback function</span><span class="kw4">void</span> acis_interrupt_checker<span class="br0">(</span> <span class="kw4">const</span> <span class="kw4">char</span>* func_name <span class="br0">)</span><span class="br0">{</span> <span class="kw1">if</span><span class="br0">(</span> end_user_requests_interrupt<span class="br0">(</span><span class="br0">)</span> <span class="br0">)</span> <span class="br0">{</span> <span class="kw3">printf</span><span class="br0">(</span><span class="st0">"Synchronous user interrupt requested during %s<span class="es0">\n</span>"</span>, func_name<span class="br0">)</span>; <span class="co1">// interrupt the current operation at the next good location</span> interrupt_acis<span class="br0">(</span><span class="br0">)</span>; <span class="br0">}</span><span class="kw1">else</span> <span class="kw1">if</span><span class="br0">(</span> end_user_requests_immediate_interrupt<span class="br0">(</span><span class="br0">)</span> <span class="br0">)</span><span class="br0">{</span> <span class="kw3">printf</span><span class="br0">(</span><span class="st0">"Asynchronous user interrupt requested during %s<span class="es0">\n</span>"</span>, func_name<span class="br0">)</span>;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -