STL Container IB Reference

From CometWiki

(Difference between revisions)
Jump to: navigation, search
(Created page with "===Core Functions=== ====Vector==== '''stlPushBack( <container-name>, <data> )''' adds an element to the end of the vector '''stlPopBack( <container-name> )''' removes the elemen...")
Line 1: Line 1:
===Core Functions===
===Core Functions===
====Vector====
====Vector====
-
'''stlPushBack( <container-name>, <data> )''' adds an element to the end of the vector
+
'''stlPushBack( <container-name>, <data> )''' adds an element to the end of the vector
-
'''stlPopBack( <container-name> )''' removes the element at the end of the vector
+
'''stlPopBack( <container-name> )''' removes the element at the end of the vector
-
'''stlFront( <container-name> )''' gets the element at the front of the vector
+
'''stlFront( <container-name> )''' gets the element at the front of the vector
-
'''stlBack( <container-name> )''' gets the element at the end of the vector
+
'''stlBack( <container-name> )''' gets the element at the end of the vector
-
'''stlSet <container-name> <index> <data>''' sets the element at the index specified
+
'''stlSet <container-name> <index> <data>''' sets the element at the index specified
-
'''<container-name>( <index> )''' gets the element at the index specified
+
'''<container-name>( <index> )''' gets the element at the index specified
Similar to arrays, vectors are mostly used to access data based on a numeric index, thus the () operator and stlSet are going to be your bread and butter functions for this container.  stlPushBack is a great way to programatically build a vector - it will append the specified data to the end of the vector, and increase its size by 1.  If you want to remove the last element, you would use stlPopBack.  Then the stlFront and stlBack functions have been included as shortcuts for accessing the first and last elements respectively.
Similar to arrays, vectors are mostly used to access data based on a numeric index, thus the () operator and stlSet are going to be your bread and butter functions for this container.  stlPushBack is a great way to programatically build a vector - it will append the specified data to the end of the vector, and increase its size by 1.  If you want to remove the last element, you would use stlPopBack.  Then the stlFront and stlBack functions have been included as shortcuts for accessing the first and last elements respectively.
====List====
====List====
 +
'''stlPushBack( <container-name>, <data> )''' adds and element to the end of the list
 +
'''stlPopBack( <container-name> )''' removes the element at the end of the list
 +
'''stlPushFront( <container-name>, <data> )''' adds and element to the beginning of the list
 +
'''stlPopFront( <container-name> )''' removes the element at the beginning of the list
 +
'''stlFront( <container-name> )''' gets the element at the beginning of the list
 +
'''stlBack( <container-name> )''' gets the element at the end of the list
 +
====Map====
====Map====
====Stack====
====Stack====

Revision as of 23:49, 22 November 2011

Contents

Core Functions

Vector

stlPushBack( <container-name>, <data> ) adds an element to the end of the vector
stlPopBack( <container-name> ) removes the element at the end of the vector
stlFront( <container-name> ) gets the element at the front of the vector
stlBack( <container-name> ) gets the element at the end of the vector
stlSet <container-name> <index> <data> sets the element at the index specified
<container-name>( <index> ) gets the element at the index specified

Similar to arrays, vectors are mostly used to access data based on a numeric index, thus the () operator and stlSet are going to be your bread and butter functions for this container. stlPushBack is a great way to programatically build a vector - it will append the specified data to the end of the vector, and increase its size by 1. If you want to remove the last element, you would use stlPopBack. Then the stlFront and stlBack functions have been included as shortcuts for accessing the first and last elements respectively.

List

stlPushBack( <container-name>, <data> ) adds and element to the end of the list
stlPopBack( <container-name> ) removes the element at the end of the list
stlPushFront( <container-name>, <data> ) adds and element to the beginning of the list
stlPopFront( <container-name> ) removes the element at the beginning of the list
stlFront( <container-name> ) gets the element at the beginning of the list
stlBack( <container-name> ) gets the element at the end of the list

Map

Stack

Queue

Utility Functions

Meta Functions

Personal tools