📄 vxwlist.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/VXWList.html - generated by refgen from /vobs/wpwr/docs/vxworks/ref/VXWList.i --> <title> VXWList </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual : Wind Foundation Classes</i></a></p></blockquote><h1>VXWList</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>VXWList</strong> - simple linked list class</p></blockquote><h4>METHODS</h4><blockquote><p><p><b><i><a href="./VXWList.html#VXWList::VXWList">VXWList::VXWList</a></i>( )</b> - initialize a list<br><b><i><a href="./VXWList.html#VXWList::VXWList_1">VXWList::VXWList</a></i>( )</b> - initialize a list as a copy of another<br><b><i><a href="./VXWList.html#VXWList::~VXWList">VXWList::~VXWList</a></i>( )</b> - free up a list<br><b><i><a href="./VXWList.html#VXWList::add">VXWList::add</a></i>( )</b> - add a node to the end of list<br><b><i><a href="./VXWList.html#VXWList::concat">VXWList::concat</a></i>( )</b> - concatenate two lists<br><b><i><a href="./VXWList.html#VXWList::count">VXWList::count</a></i>( )</b> - report the number of nodes in a list<br><b><i><a href="./VXWList.html#VXWList::extract">VXWList::extract</a></i>( )</b> - extract a sublist from list<br><b><i><a href="./VXWList.html#VXWList::find">VXWList::find</a></i>( )</b> - find a node in list<br><b><i><a href="./VXWList.html#VXWList::first">VXWList::first</a></i>( )</b> - find first node in list<br><b><i><a href="./VXWList.html#VXWList::get">VXWList::get</a></i>( )</b> - delete and return the first node from list<br><b><i><a href="./VXWList.html#VXWList::insert">VXWList::insert</a></i>( )</b> - insert a node in list after a specified node<br><b><i><a href="./VXWList.html#VXWList::last">VXWList::last</a></i>( )</b> - find the last node in list<br><b><i><a href="./VXWList.html#VXWList::next">VXWList::next</a></i>( )</b> - find the next node in list<br><b><i><a href="./VXWList.html#VXWList::nStep">VXWList::nStep</a></i>( )</b> - find a list node <i>nStep</i> steps away from a specified node<br><b><i><a href="./VXWList.html#VXWList::nth">VXWList::nth</a></i>( )</b> - find the Nth node in a list<br><b><i><a href="./VXWList.html#VXWList::previous">VXWList::previous</a></i>( )</b> - find the previous node in list<br><b><i><a href="./VXWList.html#VXWList::remove">VXWList::remove</a></i>( )</b> - delete a specified node from list<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>The VXWList class supports the creation and maintenance of a doublylinked list. The class contains pointers to the first and lastnodes in the list, and a count of the number of nodes in the list.The nodes in the list are derived from the structure NODE, whichprovides two pointers: <b>NODE::next</b> and <b>NODE::previous</b>.Both the forward and backward chains are terminated with a NULL pointer.<p>The VXWList class simply manipulates the linked-list data structures;no kernel functions are invoked. In particular, linked lists by themselvesprovide no task synchronization or mutual exclusion. If multiple tasks willaccess a single linked list, that list must be guarded with somemutual-exclusion mechanism (such as a mutual-exclusion semaphore).<p></blockquote><h4>NON-EMPTY LIST</h4><blockquote><p><p><pre> --------- -------- -------- | head--------------->| next----------->| next--------- | | | | | | | | | ------- prev |<---------- prev | | | | | | | | | | | tail------ | | ... | ----->| ... | | | | | v | v |count=2| | ----- | ----- --------- | --- | --- | - | - | | ------------------------</pre></blockquote><h4>EMPTY LIST</h4><blockquote><p><p><pre> ----------- | head------------------ | | | | tail---------- | | | | v | count=0 | ----- ----- ----------- --- --- - -</pre></blockquote><h4>WARNINGS</h4><blockquote><p>Use only single inheritance! This class is an interface to theVxWorks library lstLib. More sophisticated alternatives areavailable in the <b>Tools.h</b>++ class libraries.<p></blockquote><h4>EXAMPLE</h4><blockquote><p>The following example illustrates how to create a list by derivingelements from NODE and putting them on a VXWList.<p><pre>class myListNode : public NODE { public: myListNode () { } private: };VXWList myList;myListNode a, b, c;NODE * pEl = &c;void useList () { myList.add (&a); myList.insert (pEl, &b); }</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>vxwLstLib.h</b><p><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::VXWList"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::VXWList</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::VXWList</i>( )</strong> - initialize a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre> VXWList ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor initializes a list as an empty list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::VXWList_1"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::VXWList</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::VXWList</i>( )</strong> - initialize a list as a copy of another</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>VXWList ( const VXWList & )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This constructor builds a new list as a copy of an existing list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::~VXWList"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::~VXWList</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::~VXWList</i>( )</strong> - free up a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre> ~VXWList ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This destructor frees up memory used for nodes.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::add"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::add</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::add</i>( )</strong> - add a node to the end of list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void add ( NODE * pNode )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine adds a specified node to the end of the list.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::concat"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::concat</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::concat</i>( )</strong> - concatenate two lists</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void concat ( VXWList &aList )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine concatenates the specified list to the end of the current list.The specified list is left empty. Either list (or both) can beempty at the beginning of the operation.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::count"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::count</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::count</i>( )</strong> - report the number of nodes in a list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre> int count ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine returns the number of nodes in a specified list.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>The number of nodes in the list.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./VXWList.html#top">VXWList</a></b><hr><a name="VXWList::extract"></a><p align=right><a href="rtnIndex.html"><i>Wind Foundation Classes : Methods</i></a></p></blockquote><h1><i>VXWList::extract</i>( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong><i>VXWList::extract</i>( )</strong> - extract a sublist from list</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>LIST extract ( NODE * pStart, NODE * pEnd )</pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -