modularMX
containers.
More...
#include <mxmContainer.h>
Inheritance diagram for mxmContainer:
Public Member Functions | |
mxmContainer () | |
Default constructor. | |
mxmContainer (mxmTypeDecider *item_type_decider) | |
Pass to this constructor an appropriate type decider if you wish to restrict the set of possible mxmObject types that can be added to this container. | |
~mxmContainer () | |
Also toasts the encapsuled item type decider. | |
void | clear (void) |
(Re)implementation for interface mxmContainerInterface. | |
void | setItemTypeDecider (mxmTypeDecider *item_type_decider) |
Item type decider to be used from now on. | |
Protected Attributes | |
mxmTypeDecider * | ItemTypeDecider |
modularMX
containers.
When we purged the camera filesystem of the prohibitively large libstdc++
and installed our MX
C++ mini-runtime instead, we somehow had to come up with a replacement for the widely used STL
container templates, such as vector
, list
and map
. These replacements are the subclasses to mxmContainer.
In contrast to the STL
containers, modularMX
containers manage items that are subclassed from mxmObject, allocated dynamically on the heap via new
, and referenced by pointers. When added to a container, the ownership over an item is transferred to that container that will delete it porperly the moment it is destroyed itself.
The set of object types that can be added to a container can be, but does not have to be, restricted by installing an mxmTypeDecider with the container, that will then most likely use RTTI
(runtime type information) to reject invalid types.
The items stored in a container can be investigated and possibly modified via iterators. To obtain an iterator for a given specific mxmContainer implementation, call its iterator()
method, such as for example mxmList::iterator().
[khe]
Kai Hergenroether
|
Pass to this constructor an appropriate type decider if you wish to restrict the set of possible mxmObject types that can be added to this container. The container assumes ownership over the type decider. |
|
Item type decider to be used from now on. The container assumes ownership over the type decider. A potentially previously installed decider gets deleted. |