OpenMAMA
timer.h
Go to the documentation of this file.
1 /* $Id$
2  *
3  * OpenMAMA: The open middleware agnostic messaging API
4  * Copyright (C) 2011 NYSE Technologies, Inc.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301 USA
20  */
21 
22 #ifndef WTimerH__
23 #define WTimerH__
24 
25 #include <mama/status.h>
26 #include <mama/types.h>
27 #include <mama/queue.h>
28 
29 #if defined( __cplusplus )
30 extern "C"
31 {
32 #endif /* defined( __cplusplus ) */
33 
40 typedef void (MAMACALLTYPE *mamaTimerCb)(mamaTimer timer, void *closure);
41 
56 MAMAExpDLL
57 extern mama_status
59  mamaQueue queue,
60  mamaTimerCb action,
61  mama_f64_t interval,
62  void* closure);
63 
80 MAMAExpDLL
81 extern mama_status
83  mamaQueue queue,
84  mamaTimerCb action,
85  mamaTimerCb onTimerDestroyed,
86  mama_f64_t interval,
87  void* closure);
88 
95 MAMAExpDLL
96 extern mama_status
98  mamaQueue queue);
99 
108 MAMAExpDLL
109 extern mama_status
111  mamaQueue queue,
112  mamaTimerCb onTimerDestroyed);
113 
126 MAMAExpDLL
127 extern mama_status
129  mamaTimerCb action,
130  mama_f64_t interval,
131  void* closure);
132 
143 MAMAExpDLL
144 extern mama_status
146 
152 MAMAExpDLL
153 extern mama_status
155 
163 MAMAExpDLL
164 extern mama_status
166  mama_f64_t interval);
167 
174 MAMAExpDLL
175 extern mama_status
176 mamaTimer_getInterval(const mamaTimer timer,
177  mama_f64_t* interval);
178 
185 MAMAExpDLL
186 extern mama_status
187 mamaTimer_getQueue (const mamaTimer timer,
188  mamaQueue* queue);
189 
190 #if defined( __cplusplus )
191 }
192 #endif /* defined( __cplusplus ) */
193 
194 #endif /* WTimerH__ */
MAMAExpDLL mama_status mamaTimer_destroy(mamaTimer timer)
Destroy the timer.
MAMAExpDLL mama_status mamaTimer_create(mamaTimer *result, mamaQueue queue, mamaTimerCb action, mama_f64_t interval, void *closure)
Create a repeating timer.
MAMAExpDLL mama_status mamaTimer_getQueue(const mamaTimer timer, mamaQueue *queue)
Return the mamaQueue for this timer.
const char mamaFtState void * closure
Definition: ft.h:54
void(MAMACALLTYPE * mamaTimerCb)(mamaTimer timer, void *closure)
Prototype for callback invoked by timer.
Definition: timer.h:40
MAMAExpDLL mama_status mamaTimer_create2(mamaTimer *result, mamaQueue queue, mamaTimerCb action, mamaTimerCb onTimerDestroyed, mama_f64_t interval, void *closure)
Create a repeating timer.
struct mamaQueueImpl_ * mamaQueue
Definition: types.h:107
MAMAExpDLL mama_status mamaTimer_setInterval(mamaTimer timer, mama_f64_t interval)
Set the timer to use a different interval (and reset to the beginning of that interval).
MAMAExpDLL mama_status mamaTimer_getInterval(const mamaTimer timer, mama_f64_t *interval)
Get the current timer interval.
double mama_f64_t
Definition: types.h:44
MAMAExpDLL mama_status mamaTimer_start(mamaTimer result, mamaTimerCb action, mama_f64_t interval, void *closure)
Start a repeating timer created using allocate.
mama_status
Definition: status.h:37
MAMAExpDLL mama_status mamaTimer_reset(mamaTimer timer)
Reset the timer to the beginning of the interval.
struct mamaTimerImpl * mamaTimer
Definition: types.h:109
MAMAExpDLL mama_status mamaTimer_allocate(mamaTimer *result, mamaQueue queue)
Allocate a repeating timer.
typedef void(MAMACALLTYPE *mamaFtMemberOnFtStateChangeCb)(mamaFtMember ftMember
Callback function type for MAMA fault tolerance events.
MAMAExpDLL mama_status mamaTimer_allocate2(mamaTimer *result, mamaQueue queue, mamaTimerCb onTimerDestroyed)
Allocate a repeating timer.


© 2012 Linux Foundation