OpenMAMA C++ API
Wombat::MamaSymbolListFile Class Reference

MamaSymbolListFile is a file based symbol list with the ability to detect external changes to the file. More...

#include <MamaSymbolListFile.h>

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

Public Member Functions

 MamaSymbolListFile ()
 
 ~MamaSymbolListFile ()
 
void setFileName (const char *fileName)
 Set the file name. More...
 
void setBridge (const mamaBridge bridge)
 Set the bridge to use for creating transports. More...
 
void readFile ()
 Read the contents of the file into the symbol list. More...
 
void writeFile ()
 Write the symbol list to the file. More...
 
void setFileMonitor (double checkSeconds, MamaQueue *queue)
 Set a timer to check whether the file has changed its contents. More...
 
- Public Member Functions inherited from Wombat::MamaSymbolList
 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...
 

Additional Inherited Members

- Public Attributes inherited from Wombat::MamaSymbolList
MamaSymbolListImpl * myPimpl
 
- Protected Attributes inherited from Wombat::MamaSymbolList
mamaSymbolList myList
 

Detailed Description

MamaSymbolListFile is a file based symbol list with the ability to detect external changes to the file.

The file's structure is as follows:

  • One symbol per line.
  • Whitespace-separated columns for the symbol, the source and the MAMA transport name.
  • The source and transport names are optional; if the transport name is present then so must be the source name.

For example: IBM CTA default DIS CTA default MSFT NASDAQ default

Constructor & Destructor Documentation

§ MamaSymbolListFile()

Wombat::MamaSymbolListFile::MamaSymbolListFile ( )

§ ~MamaSymbolListFile()

Wombat::MamaSymbolListFile::~MamaSymbolListFile ( )

Member Function Documentation

§ setFileName()

void Wombat::MamaSymbolListFile::setFileName ( const char *  fileName)

Set the file name.

§ setBridge()

void Wombat::MamaSymbolListFile::setBridge ( const mamaBridge  bridge)

Set the bridge to use for creating transports.

§ readFile()

void Wombat::MamaSymbolListFile::readFile ( )

Read the contents of the file into the symbol list.

§ writeFile()

void Wombat::MamaSymbolListFile::writeFile ( )

Write the symbol list to the file.

§ setFileMonitor()

void Wombat::MamaSymbolListFile::setFileMonitor ( double  checkSeconds,
MamaQueue queue 
)

Set a timer to check whether the file has changed its contents.

If the contents have changed, various add/remove membership events may be applied to the MamaSymbolList.