home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / il / ilIndexableList.z / ilIndexableList
Encoding:
Text File  |  2002-10-03  |  7.9 KB  |  264 lines

  1.  
  2.  
  3.  
  4. iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt - Indexable linked list
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      This class has only private inheritances from base classes.
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <il/ilIndexableList.h>
  16.  
  17. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.      ilIndexableList is privately derived from the ilList class.  ilIndexable
  19.      list provides a lightweight, fast, doubly-linked list that can be indexed
  20.      by an integer.  The class maintains a cache of the last accessed
  21.      position, and uses that to provide fast positioning within the list. The
  22.      index is constrained from zero (the head of the list) to the list length
  23.      minus one.
  24.  
  25.      UUUUssssiiiinnnngggg iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt
  26.      To make a list of integers, for example, define a derivation of
  27.      ilLinkItem to hold the integer:
  28.  
  29.           struct intItem : public ilLinkItem {
  30.               int i;
  31.           };
  32.  
  33.      Next, build a list of these integers:
  34.  
  35.           ilIndexableList list;
  36.           for (int i = 0; i < 10; i++) {
  37.               intItem* item = new intItem;
  38.               item->i = i;
  39.               list.append(item);
  40.           }
  41.  
  42.      In the example above, the _a_p_p_e_n_d function was used to place the items on
  43.      the list.  Once the list is created, it can be manipulated.
  44.  
  45. CCCCLLLLAAAASSSSSSSS MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN SSSSUUUUMMMMMMMMAAAARRRRYYYY
  46.      CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  47.  
  48.           ilIndexableList()
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                                         PPPPaaaaggggeeee 1111
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  69.  
  70.  
  71.  
  72.      EEEEddddiiiittttiiiinnnngggg
  73.  
  74.           void append(ilLinkItem* item)
  75.           void appendAt(int index, ilLinkItem* item)
  76.           void insert(ilLinkItem* item)
  77.           void insertAt(int index, ilLinkItem* item)
  78.           void unlink(ilLinkItem* item)
  79.           void unlinkAt(int index)
  80.  
  81.  
  82.      QQQQuuuueeeerrrryyyy
  83.  
  84.           int length()
  85.           ilLinkItem* head()
  86.           ilLinkItem* tail()
  87.           ilLinkItem* findLink(int index)
  88.           ilLinkItem* operator[](int index)
  89.           ilLinkItem*  getNext(const ilLinkItem* item)
  90.           ilLinkItem*  getPrev(const ilLinkItem* item)
  91.           int isValid()
  92.  
  93.  
  94. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  95.      iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt(((())))
  96.  
  97.           ilIndexableList()
  98.  
  99.  
  100.           Creates an ilIndexableList of length zero (that is, empty list).
  101.  
  102.      aaaappppppppeeeennnndddd(((())))
  103.  
  104.           void append(ilLinkItem* item)
  105.  
  106.  
  107.           Appends _i_t_e_m to the end of the list.
  108.  
  109.      aaaappppppppeeeennnnddddAAAAtttt(((())))
  110.  
  111.           void appendAt(int index, ilLinkItem* item)
  112.  
  113.  
  114.           Places _i_t_e_m after _i_n_d_e_x in the list.  If _i_n_d_e_x is out of range, then
  115.           the _i_t_e_m is apppended to the end of the list.
  116.  
  117.      hhhheeeeaaaadddd(((())))
  118.  
  119.           ilLinkItem* head()
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                                         PPPPaaaaggggeeee 2222
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  135.  
  136.  
  137.  
  138.           Returns the item at the head of the list or NULL if the list is
  139.           empty.
  140.  
  141.      ffffiiiinnnnddddLLLLiiiinnnnkkkk(((())))
  142.  
  143.           ilLinkItem* findLink(int index)
  144.  
  145.  
  146.           Returns the item at _i_n_d_e_x.
  147.  
  148.      ggggeeeettttNNNNeeeexxxxtttt(((())))
  149.  
  150.           ilLinkItem*  getNext(const ilLinkItem* item)
  151.  
  152.  
  153.           Returns the list element following _i_t_e_m.
  154.  
  155.      ggggeeeettttPPPPrrrreeeevvvv(((())))
  156.  
  157.           ilLinkItem*  getPrev(const ilLinkItem* item)
  158.  
  159.  
  160.           Returns the list element preceding _i_t_e_m.
  161.  
  162.      iiiinnnnsssseeeerrrrtttt(((())))
  163.  
  164.           void insert(ilLinkItem* item)
  165.  
  166.  
  167.           Inserts _i_t_e_m at the front of the list.
  168.  
  169.      iiiinnnnsssseeeerrrrttttAAAAtttt(((())))
  170.  
  171.           void insertAt(int index, ilLinkItem* item)
  172.  
  173.  
  174.           Places _i_t_e_m before _i_n_d_e_x in the list.  If _i_n_d_e_x is out of range,
  175.           then the _i_t_e_m is appended to the end of the list.
  176.  
  177.      iiiissssVVVVaaaalllliiiidddd(((())))
  178.  
  179.           int isValid()
  180.  
  181.  
  182.           Returns TRUE if 'this' linked list is a valid list without any
  183.           irregularities and a FALSE otherwise. A list is valid if each node
  184.           or item points correctly to the next and previous item on the list.
  185.  
  186.      lllleeeennnnggggtttthhhh(((())))
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                                                         PPPPaaaaggggeeee 3333
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200. iiiillllIIIInnnnddddeeeexxxxaaaabbbblllleeeeLLLLiiiisssstttt((((3333))))                    IIIImmmmaaaaggggeeeeVVVViiiissssiiiioooonnnn LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll
  201.  
  202.  
  203.  
  204.           int length()
  205.  
  206.  
  207.           Returns the number of items in the list. If the list is empty, the
  208.           returned value is 0.
  209.  
  210.      ooooppppeeeerrrraaaattttoooorrrr[[[[]]]]
  211.  
  212.           ilLinkItem* operator[](int index)
  213.  
  214.  
  215.           Returns the item at _i_n_d_e_x.  Same as _f_i_n_d_L_i_n_k.
  216.  
  217.      ttttaaaaiiiillll(((())))
  218.  
  219.           ilLinkItem* tail()
  220.  
  221.  
  222.           Returns the item at the tail of the list or NULL if the list is
  223.           empty.
  224.  
  225.      uuuunnnnlllliiiinnnnkkkk(((())))
  226.  
  227.           void unlink(ilLinkItem* item)
  228.  
  229.  
  230.           Unlinks the _i_t_e_m from the list.  If _i_t_e_m is not on the list, the
  231.           result is undefined.
  232.  
  233.      uuuunnnnlllliiiinnnnkkkkAAAAtttt(((())))
  234.  
  235.           void unlinkAt(int index)
  236.  
  237.  
  238.           Unlinks the item at _i_n_d_e_x.
  239.  
  240. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  241.      ilIndexableStack
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.                                                                         PPPPaaaaggggeeee 4444
  260.  
  261.  
  262.  
  263.