A MamaSourceGroup monitors a set of MamaSources that presumably provide a duplicate set of data. More…
Inherits from Wombat.MamaWrapper, IEnumerable
Name | |
---|---|
interface | StateChangedRegistration Encapsulates a registration of a state-change mCallback for a particular source mGroup |
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 |
Name | |
---|---|
virtual override MamaStatus.mamaStatus | DestroyNativePeer() Implements the destruction of the underlying peer object. MamaWrapper.DestroyNativePeer |
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. |
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 |
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
MamaSourceGroup(
string groupName
)
Constructs and creates a new source mGroup object. M:Wombat.MamaWrapper.::ctor
Parameters:
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.
Parameters:
Return: The source if found, null otherwise
void add(
MamaSource source,
uint weight
)
Add a mamaSource to the specified mGroup with the specified weighting.
Parameters:
The source id will be used by the mGroup to uniquely identify the source.
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.
Parameters:
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.
Parameters:
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.
Parameters:
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.
IEnumerator GetEnumerator()
Provides an enumerator over the sources in the source mGroup
Return:
virtual override MamaStatus.mamaStatus DestroyNativePeer()
Implements the destruction of the underlying peer object. MamaWrapper.DestroyNativePeer
Reimplements: Wombat::MamaWrapper::DestroyNativePeer
string name;
Return the name string identifier for the specified source mGroup.
uint size;
Returns the number of sources in this source mGroup
The size is evaluated every time, so cache it before entering a loop
int sizeClsCompliant;
CLS compliant version of size
MamaSource topWeightSource;
Return the top weighted source for this source mGroup.
Updated on 2023-03-31 at 15:29:33 +0100