C++ Portable Types Library (PTypes) Version 1.7

Top: Basic types: Lists: objlist

The objlist class is a dynamic array of pointers to objects derived from unknown. This class provides methods to add, insert, delete or access objects by index. Objlist itself is derived from unknown.

When an item is removed from the list, or the entire list is cleared (using clear() function) or destroyed, the objects are not freed from memory unless the parameter ownobjects was set to true during construction of the list. "Owning objects" means the string list is responsible for destroying and freeing its member objects.

A class template named tobjlist, fully compatible with objlist, is provided for better type checking at compile time. If you declare a variable, for example, of type tobjlist<myclass>, all manipulation functions for this variable will accept and return pointers to myclass, instead of unknown.

This class is declared in <ptypes.h> header file.

See also: unknown, Constructors/destructors, Manipulation

PTypes home