A repeating timer
Inherits from Wombat.MamaWrapper, IDisposable
Name | |
---|---|
delegate void | OnTimerTickDelegate(IntPtr timer, IntPtr closure) This delegate describes the native callback functions invoked for timer tick and destroy events. |
MamaTimer() Construct a timer object. |
|
MamaTimer(IntPtr nativeHandle) Construct a timer object using a precreated native timer. |
|
void | create(MamaQueue queue, MamaTimerCallback action, double interval) Create a repeating timer. Since the MamaTimer relies on the timer mechanism of the underlying middleware, the resolution of the timer is also dependent on the middleware. Consult your middleware documentation for details. The callback is invoked repeatedly at the specified interval until the timer is destroyed. A null value for the queue uses the default mama queue. |
void | create(MamaQueue queue, MamaTimerCallback action, double interval, object closure) Create a repeating timer. Since the MamaTimer relies on the timer mechanism of the underlying middleware, the resolution of the timer is also dependent on the middleware. Consult your middleware documentation for details. The callback is invoked repeatedly at the specified interval until the timer is destroyed. A null value for the queue uses the default mama queue. |
void | destroy() Destroy the timer. This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching. This is functionally equivalent to disposing the instance. |
double | getInterval() Get the current timer interval. |
void | reset() Reset the timer to the beginning of the interval. |
void | setInterval(double interval) Set the timer to use a different interval (and reset to the beginning of that interval). |
Name | |
---|---|
virtual override MamaStatus.mamaStatus | DestroyNativePeer() This will be called by the base class to destroy the native timer. MamaWrapper.DestroyNativePeer |
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 |
delegate void OnTimerTickDelegate(
IntPtr timer,
IntPtr closure
)
This delegate describes the native callback functions invoked for timer tick and destroy events.
Parameters:
MamaTimer()
Construct a timer object.
MamaTimer(
IntPtr nativeHandle
)
Construct a timer object using a precreated native timer.
Parameters:
void create(
MamaQueue queue,
MamaTimerCallback action,
double interval
)
Create a repeating timer. Since the MamaTimer relies on the timer mechanism of the underlying middleware, the resolution of the timer is also dependent on the middleware. Consult your middleware documentation for details. The callback is invoked repeatedly at the specified interval until the timer is destroyed. A null value for the queue uses the default mama queue.
Parameters:
void create(
MamaQueue queue,
MamaTimerCallback action,
double interval,
object closure
)
Create a repeating timer. Since the MamaTimer relies on the timer mechanism of the underlying middleware, the resolution of the timer is also dependent on the middleware. Consult your middleware documentation for details. The callback is invoked repeatedly at the specified interval until the timer is destroyed. A null value for the queue uses the default mama queue.
Parameters:
void destroy()
Destroy the timer. This function must be called from the same thread dispatching on the associated event queue unless both the default queue and dispatch queue are not actively dispatching. This is functionally equivalent to disposing the instance.
double getInterval()
Get the current timer interval.
Return: The interval in seconds.
void reset()
Reset the timer to the beginning of the interval.
void setInterval(
double interval
)
Set the timer to use a different interval (and reset to the beginning of that interval).
Parameters:
virtual override MamaStatus.mamaStatus DestroyNativePeer()
This will be called by the base class to destroy the native timer. MamaWrapper.DestroyNativePeer
Return: MAMA Status code
Reimplements: Wombat::MamaWrapper::DestroyNativePeer
Updated on 2023-03-31 at 15:29:33 +0100