OpenMAMA C++ API
Wombat::MamaSymbolList Class Reference

MamaSymbolList manages a list of MAMA symbols and related attributes. More...

#include <MamaSymbolList.h>

Inheritance diagram for Wombat::MamaSymbolList:
Wombat::MamaSymbolListFile

Public Member Functions

 MamaSymbolList ()
 
virtual ~MamaSymbolList ()
 
void addMembershipHandler (MamaSymbolListMembershipHandler *handler)
 Add a "membership" handler that implements the MamaSymbolListMembershipHandler interface. More...
 
void addMember (MamaSymbolListMember *member)
 Add a symbol to the list. More...
 
MamaSymbolListMemberfindMember (const char *symbol, const char *source, mamaTransport transport)
 Find a symbol in the list. More...
 
MamaSymbolListMemberremoveMember (const char *symbol, const char *source, mamaTransport transport)
 Remove a symbol from the list (providing it exists in the list). More...
 
void removeMember (MamaSymbolListMember &member)
 Remove a symbol from the list (providing it exists in the list). More...
 
void removeMemberAll (void)
 Remove all symbols from the list (providing it exists in the list). More...
 
void clear ()
 Remove all symbols from the list. More...
 
void dump ()
 Dump the contents of the list to stdout. More...
 
bool empty () const
 
mama_size_t size () const
 
void setClosure (void *closure)
 Set the closure. More...
 
void * getClosure () const
 Get the closure. More...
 
void iterate (MamaSymbolListIteratorHandler &handler, void *iterateClosure=NULL)
 Iterate over all members of the symbol list. More...
 
mamaSymbolList getCValue ()
 Get the underlying Impl at C level. More...
 
const mamaSymbolList getCValue () const
 Get the underlying Impl at C level. More...
 

Public Attributes

MamaSymbolListImpl * myPimpl
 

Protected Attributes

mamaSymbolList myList
 

Detailed Description

MamaSymbolList manages a list of MAMA symbols and related attributes.

Methods are provided for creating, updating and sorting the members of the list. Handler interfaces are provided so that it is possible to handle asynchronous/external changes to the symbol list, as many types of symbol lists can be quite dynamic.

Constructor & Destructor Documentation

§ MamaSymbolList()

Wombat::MamaSymbolList::MamaSymbolList ( )

§ ~MamaSymbolList()

virtual Wombat::MamaSymbolList::~MamaSymbolList ( )
virtual

Member Function Documentation

§ addMembershipHandler()

void Wombat::MamaSymbolList::addMembershipHandler ( MamaSymbolListMembershipHandler handler)

Add a "membership" handler that implements the MamaSymbolListMembershipHandler interface.

Multiple handlers may be registered.

Parameters
handlerThe handler to be registered.

§ addMember()

void Wombat::MamaSymbolList::addMember ( MamaSymbolListMember member)

Add a symbol to the list.

The list maintains a unique list of symbols.

Parameters
memberThe symbol member to be added.

§ findMember()

MamaSymbolListMember* Wombat::MamaSymbolList::findMember ( const char *  symbol,
const char *  source,
mamaTransport  transport 
)

Find a symbol in the list.

Parameters
symbolThe name of the symbol to be removed.
sourceThe source of the symbol to be removed.
transportThe transport of the symbol to be removed.
Returns
The object containing additional information about the symbol (or NULL).

§ removeMember() [1/2]

MamaSymbolListMember* Wombat::MamaSymbolList::removeMember ( const char *  symbol,
const char *  source,
mamaTransport  transport 
)

Remove a symbol from the list (providing it exists in the list).

The member itself is not destroyed but returned as the result of this method.

Parameters
symbolThe symbol to be removed.
sourceThe source of the symbol to be removed
transportThe transport of the symbol to be removed
Returns
The member just removed (or NULL if not found)

§ removeMember() [2/2]

void Wombat::MamaSymbolList::removeMember ( MamaSymbolListMember member)

Remove a symbol from the list (providing it exists in the list).

The member itself is not destroyed.

Parameters
memberThe member to be removed.

§ removeMemberAll()

void Wombat::MamaSymbolList::removeMemberAll ( void  )

Remove all symbols from the list (providing it exists in the list).

The member itself is not destroyed.

§ clear()

void Wombat::MamaSymbolList::clear ( )

Remove all symbols from the list.

Handlers remain registered.

§ dump()

void Wombat::MamaSymbolList::dump ( )

Dump the contents of the list to stdout.

For debugging.

§ empty()

bool Wombat::MamaSymbolList::empty ( ) const
Returns
whether the symbol list is empty.

§ size()

mama_size_t Wombat::MamaSymbolList::size ( ) const
Returns
the size of the symbol list.

§ setClosure()

void Wombat::MamaSymbolList::setClosure ( void *  closure)

Set the closure.

Parameters
closureThe closure.

§ getClosure()

void* Wombat::MamaSymbolList::getClosure ( ) const

Get the closure.

Returns
The closure.

§ iterate()

void Wombat::MamaSymbolList::iterate ( MamaSymbolListIteratorHandler handler,
void *  iterateClosure = NULL 
)

Iterate over all members of the symbol list.

Parameters
handlerHandler invoked for each member of the symbol list.
iterateClosureThe closure passed to the MamaSymbolListIteratorHandler::onMember() interface.

§ getCValue() [1/2]

mamaSymbolList Wombat::MamaSymbolList::getCValue ( )

Get the underlying Impl at C level.

Returns
The mamaSymbolList

§ getCValue() [2/2]

const mamaSymbolList Wombat::MamaSymbolList::getCValue ( ) const

Get the underlying Impl at C level.

Returns
The mamaSymbolList

Member Data Documentation

§ myPimpl

MamaSymbolListImpl* Wombat::MamaSymbolList::myPimpl

§ myList

mamaSymbolList Wombat::MamaSymbolList::myList
protected