📄 x-event2.html
字号:
<dd><div class="Indent2"><a name="85296"> </a>returns the current state of the task or context. It works for all events, not just state-change events.</div><br></dl></dl></dl><dl class="margin"><dd><p class="Body"><a name="83898"> </a>Public member functions for comparison and equality of two event objects are also provided. These allow <b class="symbol_lc">WVEvent</b> objects to be stored in STL containers and manipulated by STL algorithms. Thus, an application can make a copy of small parts of the event base and manipulate it in many ways. </p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/note.gif"></td><td><hr><div class="CalloutCell"><a name="88772"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">NOTE: </font></b></a>The <b class="symbol_lc">WVEventBase</b> class manages memory internally using a temporary file to provide a form of virtual memory, allowing WindView to load very large event base files without requiring very large amounts of physical memory. Copying data into non-WindView data structures incurs the memory usage that <b class="symbol_lc">WVEventBase</b> avoids.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dl class="margin"><dd><p class="Body"><a name="83903"> </a>Event objects are ordered by time, that is to say their operator<b class="symbol_lc"> <</b><b>( )</b> function compares the time-stamp of two events, which provides the natural ordering required by most searches.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="83713">WVCoords Class</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="83714"> </a>This class provides a simple way of traversing the event base and limiting or filtering the events displayed in various ways. Given an existing <b class="symbol_lc">WVEventBase</b> object, a <b class="symbol_lc">WVCoords</b> object can be created to look at events inside the event base, applying various restrictions. These restrictions include the type of event to look at, which can be any event or a specific type, and the context to search, which can be any context or a specific one.</p><dd><p class="Body"><a name="83916"> </a>The public member function <b class="symbol_lc">move</b><b>( )</b> and the operators <b class="symbol_lc">++</b> and <b class="symbol_lc">--</b> move the <b class="symbol_lc">WVCoords</b> object through the event base. They return a boolean value indicating whether the movement was made or not. If not, no more events meeting the current search criteria could be found. The <b class="symbol_lc">WVCoords</b> object can be dereferenced using the operator <b class="symbol_lc">*</b><b>( )</b> and results in a <b class="symbol_lc">WVContext::iterator</b>, which can itself be dereferenced to retrieve an actual <b class="symbol_lc">WVEvent</b> object.</p><dd><p class="Body"><a name="83922"> </a>The following public member functions are available from the class:</p></dl><dl class="margin"><dd><pre class="Code"><b><a name="83924">WVCoords(); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85331"> </a>is the default constructor. </div><br></dl></dl><dd><pre class="Code"><b><a name="83926">WVCoords(const WVEventBase*, WV_TIME, const WVContext&, EVENT_TYPE); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85332"> </a>is a constructor where the caller must provide a particular context and a particular event type.</div><br></dl></dl><dd><pre class="Code"><b><a name="83929">WVCoords(const WVEventBase*, const WVContext::iterator&); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85333"> </a>is a constructor where the caller must provide an existing <b class="symbol_lc">WVContext::iterator</b>, in other words, an existing event location within the event base.</div><br></dl></dl><dd><pre class="Code"><b><a name="83933">BOOL move(int direction); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85336"> </a>moves the coordinates object forwards (direction = 1) or backwards (direction = -1) through the event base, with possible restrictions applied.</div><br></dl></dl><dd><pre class="Code"><b><a name="83936">static WVContext anyContext(); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85337"> </a>is a helper function which returns a pseudo-<b class="symbol_UC">NULL</b> value meaning any context. This is to used when constructing an object using the <b class="symbol_lc">WVCoords</b> constructor in the four-argument form.</div><br></dl></dl><dd><pre class="Code"><b><a name="83939">static EVENT_TYPE anyEvent(); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85338"> </a>is a helper function which returns a pseudo-<b class="symbol_UC">NULL</b> value meaning any event. This is used when constructing an object using the <b class="symbol_lc">WVCoords</b> constructor in the four-argument form.</div><br></dl></dl><dd><pre class="Code"><b><a name="83942">const WVEventBase& eventBase() const; </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85340"> </a>returns the event-base object referenced by the coordinates object.</div><br></dl></dl><dd><pre class="Code"><b><a name="83952">WVContext::iterator operator*() const; </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85341"> </a>is the dereference operation; it returns an iterator indicating the specific event pointed to by the current coordinates.</div><br></dl></dl><dd><pre class="Code"><b><a name="83956">BOOL operator++(int); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85342"> </a>is a shortcut for move(-1).</div><br></dl></dl><dd><pre class="Code"><b><a name="83958">BOOL operator--(int); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85343"> </a>is a shortcut for move(1).</div><br></dl></dl><dd><pre class="Code"><b><a name="83960">void contextLock(BOOL); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85344"> </a>locks the search to the current context. </div><br></dl></dl><dd><pre class="Code"><b><a name="83962">void eventTypeLock(BOOL); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85345"> </a>locks the search to the current event type. </div><br></dl></dl><dd><pre class="Code"><b><a name="83964">void eventTypeSet(EVENT_TYPE); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85346"> </a>sets the search target event type. </div><br></dl></dl><dd><pre class="Code"><b><a name="83966">void contextSet(const WVContext&); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85347"> </a>sets the search target context. </div><br></dl></dl><dd><pre class="Code"><b><a name="83968">void timeSet(WV_TIME); </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85348"> </a>sets the search target time. </div><br></dl></dl><dd><pre class="Code"><b><a name="83970">string contextName() const; </a></b></pre><dl class="margin"><dl class="margin"><dd><div class="Indent2"><a name="85349"> </a>returns the name of current context. </div><br></dl></dl></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="83972">Supported Compilers</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="88802"> </a><a href="x-event2.html#88844">Table D-1</a> shows the compiler that can be used with the C++ API library on each host. The API library can only be expected to work with other applications if compiled with these toolchains.<p class="table"><h4 class="EntityTitle"><a name="88844"><font face="Helvetica, sans-serif" size="-1" class="sans">Table D-1: Supported Compilers </font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="88848"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Host </font></b></div></th><td width="10"> </td><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="88850"> </a><font face="Helvetica, sans-serif" size="-1" class="sans"> Compiler </font></b></div></th><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="88852"> </a>WinNT/95/98 </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="88854"> </a> MSVC 5.0 SP3 </div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="88856"> </a>Solaris </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="88858"> </a> SUNWspro 4.2 </div></td><td width="10"> </td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="88860"> </a>HP/UX </div></td><td width="10"> </td><td colspan=1 rowspan=1><div class="CellBody"><a name="88862"> </a> aCC version A.01.07</div></td><td width="10"> </td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="88801">Runtime Errors</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="85364"> </a>In general, the WindView API classes report runtime errors with C++ exceptions. All standard library exceptions, like <b class="symbol_lc">bad_alloc</b>, are caught internally. The API classes re-throw <b class="symbol_lc">wv_error</b> exceptions with suitable human-readable messages plus an integer error code. The error-code values are defined in the header <i class="textVariable">installDir</i><b class="file">/host/include/wvapi.h</b> which ships with the library.</p></dl></dl><a name="foot"><hr></a><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="x-event.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="x-event.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="x-event1.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="x-event3.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc. conversion tool: Quadralay WebWorks Publisher 4.0.11 template: CSS Template, Jan 1998 - Jefro --->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -