mxmList Class Reference
[modularMX Runtime Platform Core]

Doubly-linked list container. More...

#include <mxmList.h>

Inheritance diagram for mxmList:

mxmContainer mxmObject mxmContainerInterface mxmInterface mxmPerlStyleHash mxmStringList mx::Framework::ComponentDescriptor List of all members.

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.
mxmObjectremoveItemFromHead (void)
 Removes and returns the first item in the list.
void addItem (mxmObject *item)
 (Re)implementation for interface mxmContainerInterface.
mxmObjectremoveItem (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

Detailed Description

Doubly-linked list container.

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

Author:
[khe] Kai Hergenroether


Constructor & Destructor Documentation

mxmList::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.

The list assumes ownership over the type decider.


Member Function Documentation

void mxmList::appendItemToTail mxmObject item  )  [virtual]
 

Adds the specified item to the end of the list.

The list assumes ownership over the item.

Reimplemented in mxmPerlStyleHash.

void mxmList::prependItemToHead mxmObject item  ) 
 

Adds the specified item to the head of the list.

The list assumes ownership over the item.

mxmObject * mxmList::removeItemFromHead void   ) 
 

Removes and returns the first item in the list.

Ownership over the item is transferred back to the calling context.

Returns 0 if the list is empty.


The documentation for this class was generated from the following files:
Generated on Fri Jun 29 17:21:04 2007 for MxPEG SDK by  doxygen 1.4.6