/usr/include/mama/timer.h is in libmama-dev 2.2.2.1-11ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | /* $Id$
*
* OpenMAMA: The open middleware agnostic messaging API
* Copyright (C) 2011 NYSE Technologies, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef WTimerH__
#define WTimerH__
#include <mama/status.h>
#include <mama/types.h>
#include <mama/queue.h>
#if defined( __cplusplus )
extern "C"
{
#endif /* defined( __cplusplus ) */
/**
* Prototype for callback invoked by timer.
*
* @param timer The timer handle.
* @param closure Caller supplied closure.
*/
typedef void (MAMACALLTYPE *mamaTimerCb)(mamaTimer timer, void *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.
*
* @param result A pointer to the timer handle.
* @param queue The queue from which the timer event will be dispatched.
* @param action The callback to be invoked after the interval.
* @param closure The closure that is passed to the callback.
* @param interval: The interval in seconds.
*/
MAMAExpDLL
extern mama_status
mamaTimer_create(mamaTimer* result,
mamaQueue queue,
mamaTimerCb action,
mama_f64_t interval,
void* 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.
*
* @param result A pointer to the timer handle.
* @param queue The queue from which the timer event will be dispatched.
* @param action The callback to be invoked after the interval.
* @param onTimerDestroyed This callback will be invoked whenever the timer is destroyed,
* can be NULL.
* @param closure The closure that is passed to the callback.
* @param interval: The interval in seconds.
*/
MAMAExpDLL
extern mama_status
mamaTimer_create2(mamaTimer* result,
mamaQueue queue,
mamaTimerCb action,
mamaTimerCb onTimerDestroyed,
mama_f64_t interval,
void* closure);
/**
* Allocate a repeating timer.
*
* @param result A pointer to the timer handle.
* @param queue The queue from which the timer event will be dispatched.
*/
MAMAExpDLL
extern mama_status
mamaTimer_allocate(mamaTimer* result,
mamaQueue queue);
/**
* Allocate a repeating timer.
*
* @param result A pointer to the timer handle.
* @param queue The queue from which the timer event will be dispatched.
* @param onTimerDestroyed Callback will be invoked whenever the timer has been
* completely destroyed.
*/
MAMAExpDLL
extern mama_status
mamaTimer_allocate2(mamaTimer* result,
mamaQueue queue,
mamaTimerCb onTimerDestroyed);
/**
* Start a repeating timer created using allocate
*
* The callback is invoked repeatedly at the specified interval until the timer
* is destroyed.
*
* @param result The timer handle returned from allocate.
* @param queue The queue from which the timer event will be dispatched.
* @param action The callback to be invoked after the interval.
* @param closure The closure that is passed to the callback.
* @param interval: The interval in seconds.
*/
MAMAExpDLL
extern mama_status
mamaTimer_start(mamaTimer result,
mamaTimerCb action,
mama_f64_t interval,
void* closure);
/**
* 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.
* Note that this function is asynchronous and is only guaranteed to have finished
* whenever the onTimerDestroyed function passed to the mamaTimer_create2 has been
* called.
* @param timer The mamaTimer to be destroyed.
*/
MAMAExpDLL
extern mama_status
mamaTimer_destroy(mamaTimer timer);
/**
* Reset the timer to the beginning of the interval.
*
* @param timer The mamaTimer to be reset.
*/
MAMAExpDLL
extern mama_status
mamaTimer_reset(mamaTimer timer);
/**
* Set the timer to use a different interval (and reset to the
* beginning of that interval).
*
* @param timer The mamaTimer to change the interval.
* @param interval The new interval for the timer.
*/
MAMAExpDLL
extern mama_status
mamaTimer_setInterval(mamaTimer timer,
mama_f64_t interval);
/**
* Get the current timer interval.
*
* @param timer The mamaTimer.
* @param interval Address of the location where the interval will be written.
*/
MAMAExpDLL
extern mama_status
mamaTimer_getInterval(const mamaTimer timer,
mama_f64_t* interval);
/**
* Return the <code>mamaQueue</code> for this timer.
*
* @param timer The timer.
* @param queue A pointer to hold the queue.
*/
MAMAExpDLL
extern mama_status
mamaTimer_getQueue (const mamaTimer timer,
mamaQueue* queue);
#if defined( __cplusplus )
}
#endif /* defined( __cplusplus ) */
#endif /* WTimerH__ */
|