#include <mxmList.h>
Inheritance diagram for mxmList:
Public Member Functions | |
mxmList () | |
Default Constructor. | |
mxmList (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 list. | |
~mxmList () | |
The list owns its items - all list items get destroyed along the way also. | |
mxmList::Iterator | iterator (void) const |
Provides the calling context with an external iterator. | |
virtual void | appendItemToTail (mxmObject *item) |
Adds the specified item to the end of the list. | |
void | prependItemToHead (mxmObject *item) |
Adds the specified item to the head of the list. | |
mxmObject * | removeItemFromHead (void) |
Removes and returns the first item in the list. | |
void | addItem (mxmObject *item) |
(Re)implementation for interface mxmContainerInterface. | |
mxmObject * | removeItem (void) |
(Re)implementation for interface mxmContainerInterface. | |
int | size (void) const |
(Re)implementation for interface mxmContainerInterface. | |
Private Member Functions | |
void | init_mxmList (void) |
Private Attributes | |
Node | Anchor |
int | ItemNum |
void * | StableABIDataExtension |
Friends | |
class | Iterator |
Classes | |
class | Iterator |
Iterator implementation for mxmList s. More... | |
struct | Node |
We introduced this class as replacement for the respective memory management facilitiy when we abandoned libstdc++
.
Have a look at what you can do to lists:
mxmList list(new mxmStringDecider()); // only allow mxmString s mxmString *da_string; // as items char da_txt[100]; int i;
for(i = 0; i < 100; i++) { std::sprintf(da_txt, "TestText #%d", i); da_string = new mxmString(da_txt); list.addItem(da_string); // fill the list }
std::printf("list size=%d\n", list.size()); // get # of items
mxmList::Iterator iter = list.iterator(); // iterate over all items while(da_string = static_cast<mxmString *>(iter.nextItem())) { std::printf("Item : %s\n", da_string->text()); }
list.clear(); // delete all items
[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 list. The list assumes ownership over the type decider. |
|
Adds the specified item to the end of the list. The list assumes ownership over the item. Reimplemented in mxmPerlStyleHash. |
|
Adds the specified item to the head of the list. The list assumes ownership over the item. |
|
Removes and returns the first item in the list. Ownership over the item is transferred back to the calling context.
Returns |