Classes Files

Wombat::MamaSourceGroup

A MamaSourceGroup monitors a set of MamaSources that presumably provide a duplicate set of data. More…

Inherits from Wombat.MamaWrapper, IEnumerable

Public Classes

  Name
interface StateChangedRegistration
Encapsulates a registration of a state-change mCallback for a particular source mGroup

Public Functions

  Name
  MamaSourceGroup(string groupName)
Constructs and creates a new source mGroup object. M:Wombat.MamaWrapper.::ctor
void destroy()
Destroy the source. A synonym to the MamaWrapper.Dispose method.
MamaSource find(string sourceName)
Find a source with the given name in the mGroup.
void add(MamaSource source, uint weight)
Add a mamaSource to the specified mGroup with the specified weighting.
void add(MamaSource source, int weight)
CLS compliant version of add(MamaSource, UInt32)
void add(string sourceName, uint weight, MamaSource source)
Add a mamaSource to the specified mGroup with the specified weighting and string name identifier.
void add(string sourceName, int weight, MamaSource source)
CLS compliant version of add(System.String, UInt32, MamaSource)
void setWeight(string sourceName, uint weight)
Set the weight for an existing mamaSource in the specified mGroup.
void setWeight(string sourceName, int weight)
CLS compliant version of setWeight(System.String, UInt32)
StateChangedRegistration registerStateChangeCallback(MamaSourceStateChangeCallback mCallback)
The mCallback interface registered here will receive a mCallback whenever the state of sources in the mGroup changes.
bool reevaluate()
Re-evaluate the mGroup by checking all of the relative weights and changing the state of each MamaSource in the mGroup as appropriate.
IEnumerator GetEnumerator()
Provides an enumerator over the sources in the source mGroup

Protected Functions

  Name
virtual override MamaStatus.mamaStatus DestroyNativePeer()
Implements the destruction of the underlying peer object. MamaWrapper.DestroyNativePeer

Public Properties

  Name
string name
Return the name string identifier for the specified source mGroup.
uint size
Returns the number of sources in this source mGroup
int sizeClsCompliant
CLS compliant version of size
MamaSource topWeightSource
Return the top weighted source for this source mGroup.

Additional inherited members

Public Functions inherited from Wombat.MamaWrapper

  Name
void Dispose()
Destroys the underlying peer object and unbinds the wrapper from it.
void setNativeHandle(IntPtr nHandle)
Sets the native handle of the native peer object. Should only be used by subclasses and in the same assembly.

Protected Functions inherited from Wombat.MamaWrapper

  Name
  MamaWrapper()
Constructs a new wrapper object but doesn’t create it. If the object is not explicitly disposed it will remain registered for finalization and will attempt the destroy the native peer object when finalized.
  MamaWrapper(IntPtr nativeHandle)
Constructs a managed wrapper from an existing native peer. The peer object will not be automatically finalized
virtual void Dispose(bool disposing, bool destroyNativeHandle =true)
The actual implementation of Dispose - called by both the Dispose method and the finalizer.
virtual void OnDispose()

Protected Attributes inherited from Wombat.MamaWrapper

  Name
IntPtr nativeHandle
the handle to the native peer object

Detailed Description

class Wombat::MamaSourceGroup;

A MamaSourceGroup monitors a set of MamaSources that presumably provide a duplicate set of data.

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

Public Functions Documentation

function MamaSourceGroup

MamaSourceGroup(
    string groupName
)

Constructs and creates a new source mGroup object. M:Wombat.MamaWrapper.::ctor

Parameters:

  • groupName The string identifier for the source mGroup.

function destroy

void destroy()

Destroy the source. A synonym to the MamaWrapper.Dispose method.

function find

MamaSource find(
    string sourceName
)

Find a source with the given name in the mGroup.

Parameters:

  • sourceName The name identifier for the source being located.

Return: The source if found, null otherwise

function add

void add(
    MamaSource source,
    uint weight
)

Add a mamaSource to the specified mGroup with the specified weighting.

Parameters:

  • source The mamaSource being added to the mamaSourceGroup.
  • weight The weighing to apply to the source being added.

The source id will be used by the mGroup to uniquely identify the source.

function add

void add(
    MamaSource source,
    int weight
)

CLS compliant version of add(MamaSource, UInt32)

function add

void add(
    string sourceName,
    uint weight,
    MamaSource source
)

Add a mamaSource to the specified mGroup with the specified weighting and string name identifier.

Parameters:

  • sourceName The unique identifier for this source in this mGroup.
  • weight The weighing to apply to the source being added.
  • source The mamaSource being added to the mamaSourceGroup.

function add

void add(
    string sourceName,
    int weight,
    MamaSource source
)

CLS compliant version of add(System.String, UInt32, MamaSource)

function setWeight

void setWeight(
    string sourceName,
    uint weight
)

Set the weight for an existing mamaSource in the specified mGroup.

Parameters:

  • sourceName The name of the source whose weight is being updated.
  • weight The new weight value for the specified source.

function setWeight

void setWeight(
    string sourceName,
    int weight
)

CLS compliant version of setWeight(System.String, UInt32)

function registerStateChangeCallback

StateChangedRegistration registerStateChangeCallback(
    MamaSourceStateChangeCallback mCallback
)

The mCallback interface registered here will receive a mCallback whenever the state of sources in the mGroup changes.

Parameters:

  • mCallback The mCallback object

function reevaluate

bool reevaluate()

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

Return: Returns true if any states were changed; otherwise false.

function GetEnumerator

IEnumerator GetEnumerator()

Provides an enumerator over the sources in the source mGroup

Return:

Protected Functions Documentation

function DestroyNativePeer

virtual override MamaStatus.mamaStatus DestroyNativePeer()

Implements the destruction of the underlying peer object. MamaWrapper.DestroyNativePeer

Reimplements: Wombat::MamaWrapper::DestroyNativePeer

Public Property Documentation

property name

string name;

Return the name string identifier for the specified source mGroup.

property size

uint size;

Returns the number of sources in this source mGroup

The size is evaluated every time, so cache it before entering a loop

property sizeClsCompliant

int sizeClsCompliant;

CLS compliant version of size

property topWeightSource

MamaSource topWeightSource;

Return the top weighted source for this source mGroup.


Updated on 2023-03-31 at 15:29:33 +0100