STL Containers

From CometWiki

Revision as of 22:39, 4 November 2011 by Skrach (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

The STL (Standard Template Library) in C++ is a large library consisting of a variety of standard data structures and functions that you might expect to use in all kinds of programming tasks. We have provided a standard interface to access a subset of the Containers implemented in the STL.

The STL Containers are similar to arrays in that they store collections of data. Unlike arrays though, they dynamically grow and shrink as needed.

Initialization

Containers are defined with a similar syntax to formats, with a few added options.

General Usage

Once initialized, there is a standard set of functions that provide access to the STL containers. In general, there are functions that store and access data in the containers, and there are also functions to iterate over and read data from the containers.

Container Types

The following containers have been implemented in Comet32.

Vector

Vectors are dynamic, indexable containers. Basically, they are arrays, but more robust. Like all containers, Vectors will expand and contract automatically when necessary.

List

Lists are

Stack

Stacks are indexable lists with LIFO (Last In, First Out) access. That is, the last element you add to the stack will be the first element removed.

Queue

Queues are indexable lists with FIFO (First In, First Out) access. That is, the first element you added to the stack will be the first element removed.

Map

Maps are associative arrays keyed by string indexes. Basically, a map is a vector that uses a string index instead of a numerical index.

IB Reference

stlFront

stlBack

stlSize

stlEmpty

stlClear

stlReset

stlSort

stlFront

stlBack

stlPush

stlPop

operator()

stlSet

stlPushFront

stlPopFront

stlFirst

stlLast

stlNext

stlPrev

stlReadKey

stlRead

stlWrite

Personal tools