2 * Copyright (c) 2004-2005 Mark Haverkamp
3 * Copyright (c) 2004-2005 Open Source Development Lab
7 * This software licensed under BSD license, the text of which follows:
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
12 * - Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 * - Redistributions in binary form must reproduce the above copyright notice,
15 * this list of conditions and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 * - Neither the name of the Open Source Developement Lab nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 * THE POSSIBILITY OF SUCH DAMAGE.
36 #ifndef AIS_EVT_H_DEFINED
37 #define AIS_EVT_H_DEFINED
39 typedef SaUint64T SaEvtHandleT
;
40 typedef SaUint64T SaEvtEventHandleT
;
41 typedef SaUint64T SaEvtChannelHandleT
;
42 typedef SaUint32T SaEvtSubscriptionIdT
;
46 (*SaEvtEventDeliverCallbackT
)(
47 SaEvtSubscriptionIdT subscriptionId
,
48 const SaEvtEventHandleT eventHandle
,
49 const SaSizeT eventDataSize
53 (*SaEvtChannelOpenCallbackT
)(
54 SaInvocationT invocation
,
55 SaEvtChannelHandleT channelHandle
,
60 SaEvtChannelOpenCallbackT saEvtChannelOpenCallback
;
61 SaEvtEventDeliverCallbackT saEvtEventDeliverCallback
;
64 #define SA_EVT_CHANNEL_PUBLISHER 0X1
65 #define SA_EVT_CHANNEL_SUBSCRIBER 0X2
66 #define SA_EVT_CHANNEL_CREATE 0X4
67 typedef SaUint8T SaEvtChannelOpenFlagsT
;
70 SaSizeT allocatedSize
;
76 #define SA_EVT_HIGHEST_PRIORITY 0
77 #define SA_EVT_LOWEST_PRIORITY 3
80 * Event ID values from 0 to 1000 are have special meanings
81 * and aren't used for regular events.
85 * Event ID for an allocated but not yet published event.
87 #define SA_EVT_EVENTID_NONE 0
90 * Event ID for a "lost event".
92 #define SA_EVT_EVENTID_LOST 1
95 * Pattern to indicate a "lost event" message.
97 #define SA_EVT_LOST_EVENT "SA_EVT_LOST_EVENT_PATTERN"
100 * Size of the biggest data attachment to an event.
102 #define SA_EVT_DATA_MAX_LEN (64 * 1024)
105 SaSizeT allocatedNumber
;
106 SaSizeT patternsNumber
;
107 SaEvtEventPatternT
*patterns
;
108 } SaEvtEventPatternArrayT
;
110 typedef SaUint8T SaEvtEventPriorityT
;
111 typedef SaUint64T SaEvtEventIdT
;
114 SA_EVT_PREFIX_FILTER
= 1,
115 SA_EVT_SUFFIX_FILTER
= 2,
116 SA_EVT_EXACT_FILTER
= 3,
117 SA_EVT_PASS_ALL_FILTER
= 4
118 } SaEvtEventFilterTypeT
;
121 SaEvtEventFilterTypeT filterType
;
122 SaEvtEventPatternT filter
;
126 SaSizeT filtersNumber
;
127 SaEvtEventFilterT
*filters
;
128 } SaEvtEventFilterArrayT
;
137 SaEvtHandleT
*evtHandle
,
138 const SaEvtCallbacksT
*callbacks
,
139 SaVersionT
*version
);
142 saEvtSelectionObjectGet(
143 SaEvtHandleT evtHandle
,
144 SaSelectionObjectT
*selectionObject
);
148 SaEvtHandleT evtHandle
,
149 SaDispatchFlagsT dispatchFlags
);
153 SaEvtHandleT evtHandle
);
157 SaEvtHandleT evtHandle
,
158 const SaNameT
*channelName
,
159 SaEvtChannelOpenFlagsT channelOpenFlags
,
161 SaEvtChannelHandleT
*channelHandle
);
164 saEvtChannelOpenAsync(
165 SaEvtHandleT evtHandle
,
166 SaInvocationT invocation
,
167 const SaNameT
*channelName
,
168 SaEvtChannelOpenFlagsT channelOpenFlags
);
172 SaEvtChannelHandleT channelHandle
);
176 SaEvtHandleT evtHandle
,
177 const SaNameT
*channelName
);
181 SaEvtChannelHandleT channelHandle
,
182 SaEvtEventHandleT
*eventHandle
);
186 SaEvtEventHandleT eventHandle
);
189 saEvtEventAttributesSet(
190 SaEvtEventHandleT eventHandle
,
191 const SaEvtEventPatternArrayT
*patternArray
,
192 SaEvtEventPriorityT priority
,
193 SaTimeT retentionTime
,
194 const SaNameT
*publisherName
);
197 saEvtEventAttributesGet(
198 SaEvtEventHandleT eventHandle
,
199 SaEvtEventPatternArrayT
*patternArray
,
200 SaEvtEventPriorityT
*priority
,
201 SaTimeT
*retentionTime
,
202 SaNameT
*publisherName
,
203 SaTimeT
*publishTime
,
204 SaEvtEventIdT
*eventId
);
208 SaEvtEventHandleT eventHandle
,
210 SaSizeT
*eventDataSize
);
214 SaEvtEventHandleT eventHandle
,
215 const void *eventData
,
216 SaSizeT eventDataSize
,
217 SaEvtEventIdT
*eventId
);
221 SaEvtChannelHandleT channelHandle
,
222 const SaEvtEventFilterArrayT
*filters
,
223 SaEvtSubscriptionIdT subscriptionId
);
226 saEvtEventUnsubscribe(
227 SaEvtChannelHandleT channelHandle
,
228 SaEvtSubscriptionIdT subscriptionId
);
231 saEvtEventRetentionTimeClear(
232 SaEvtChannelHandleT channelHandle
,
233 SaEvtEventIdT eventId
);
238 #endif /* AIS_EVT_H_DEFINED */