OpenMAMA C++ API
Wombat::MamaSourceGroup Class Reference

A MAMA source group monitors a set of MAMA sources that presumably provide a duplicate set of data. More...

#include <MamaSourceGroup.h>

Classes

class  iterator
 

Public Types

typedef const iterator const_iterator
 

Public Member Functions

 MamaSourceGroup (const char *name)
 
 ~MamaSourceGroup ()
 
const char * getName () const
 
MamaSourcefind (const char *sourceName)
 
const MamaSourcefind (const char *sourceName) const
 
void add (MamaSource *source, mama_u32_t weight)
 
void add (const char *sourceName, mama_u32_t weight, MamaSource *source)
 
void setWeight (const char *sourceName, mama_u32_t weight)
 
mama_u32_t getWeight (const char *sourceName) const
 
mama_size_t size () const
 
void registerStateChangeCallback (MamaSourceStateChangeCallback &cb)
 Applications interested in event notifications can register for events. More...
 
void unregisterStateChangeCallback (MamaSourceStateChangeCallback &cb)
 Applications interested in event notifications can unregister for events. More...
 
bool reevaluate ()
 Re-evaluate the group by checking all of the relative weights and changing the state of each MamaSource in the group as appropriate. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Detailed Description

A MAMA source group monitors a set of MAMA sources that presumably provide a duplicate set of data.

Each member of the group is given a priority and the member with the highest priority is given the mamaSourceState, MAMA_SOURCE_STATE_OK; the other members of the group are given the state, MAMA_SOURCE_STATE_OFF.

Member Typedef Documentation

§ const_iterator

Constructor & Destructor Documentation

§ MamaSourceGroup()

Wombat::MamaSourceGroup::MamaSourceGroup ( const char *  name)

§ ~MamaSourceGroup()

Wombat::MamaSourceGroup::~MamaSourceGroup ( )

Member Function Documentation

§ getName()

const char* Wombat::MamaSourceGroup::getName ( ) const

§ find() [1/2]

MamaSource* Wombat::MamaSourceGroup::find ( const char *  sourceName)

§ find() [2/2]

const MamaSource* Wombat::MamaSourceGroup::find ( const char *  sourceName) const

§ add() [1/2]

void Wombat::MamaSourceGroup::add ( MamaSource source,
mama_u32_t  weight 
)

§ add() [2/2]

void Wombat::MamaSourceGroup::add ( const char *  sourceName,
mama_u32_t  weight,
MamaSource source 
)

§ setWeight()

void Wombat::MamaSourceGroup::setWeight ( const char *  sourceName,
mama_u32_t  weight 
)

§ getWeight()

mama_u32_t Wombat::MamaSourceGroup::getWeight ( const char *  sourceName) const

§ size()

mama_size_t Wombat::MamaSourceGroup::size ( ) const

§ registerStateChangeCallback()

void Wombat::MamaSourceGroup::registerStateChangeCallback ( MamaSourceStateChangeCallback cb)

Applications interested in event notifications can register for events.

Parameters
cbcallback to register

§ unregisterStateChangeCallback()

void Wombat::MamaSourceGroup::unregisterStateChangeCallback ( MamaSourceStateChangeCallback cb)

Applications interested in event notifications can unregister for events.

Parameters
cbcallback to unregister

§ reevaluate()

bool Wombat::MamaSourceGroup::reevaluate ( )

Re-evaluate the group by checking all of the relative weights and changing the state of each MamaSource in the group as appropriate.

Returns true if any states were changed; otherwise false.

§ begin() [1/2]

iterator Wombat::MamaSourceGroup::begin ( )

§ begin() [2/2]

const_iterator Wombat::MamaSourceGroup::begin ( ) const

§ end() [1/2]

iterator Wombat::MamaSourceGroup::end ( )

§ end() [2/2]

const_iterator Wombat::MamaSourceGroup::end ( ) const