OpenMAMA
dictionary.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 MamaDictionaryH__
23 #define MamaDictionaryH__
24 
25 
26 #if defined (__cplusplus)
27 extern "C" {
28 #endif
29 
30 #include "mama/types.h"
31 #include "mama/fielddesc.h"
32 
33 
48 typedef void (MAMACALLTYPE *mamaDictionary_completeCallback)(mamaDictionary,void*);
49 
50 typedef void (MAMACALLTYPE *mamaDictionary_timeoutCallback)(mamaDictionary,void*);
51 
52 typedef void (MAMACALLTYPE *mamaDictionary_errorCallback)(mamaDictionary,const char*,void*);
53 
54 
59 {
64 
78 MAMAExpDLL
79 extern mama_status
81  mamaDictionary* dictionary,
82  mamaQueue queue,
83  mamaDictionaryCallbackSet dictionaryCallbacks,
85  double timeout,
86  int retries,
87  void* closure);
88 
96 MAMAExpDLL
97 extern mama_status
99  mamaDictionary* dictionary);
100 
101 
107 MAMAExpDLL
108 extern mama_status
110  mamaDictionary dictionary);
111 
118 MAMAExpDLL
119 extern mama_status
121  mamaDictionary dictionary,
122  const char** result);
123 
130 MAMAExpDLL
131 extern mama_status
133  mamaDictionary dictionary,
134  const char** result);
135 
144 MAMAExpDLL
145 extern mama_status
147  mamaDictionary dictionary,
148  mamaFieldDescriptor* result,
149  mama_fid_t fid);
150 
160 MAMAExpDLL
161 extern mama_status
163  mamaDictionary dictionary,
164  mamaFieldDescriptor* result,
165  unsigned short index);
166 
176 MAMAExpDLL
177 extern mama_status
179  mamaDictionary dictionary,
180  mamaFieldDescriptor* result,
181  const char* fname);
182 
198 MAMAExpDLL
199 extern mama_status
201  mamaDictionary dictionary,
202  const char* fname,
203  mamaFieldDescriptor* descList,
204  size_t* size);
205 
212 MAMAExpDLL
213 extern mama_status
215  mamaDictionary dictionary,
216  mama_fid_t* value);
217 
224 MAMAExpDLL
225 extern mama_status
227  mamaDictionary dictionary,
228  size_t* value);
229 
236 MAMAExpDLL
237 extern mama_status
239  mamaDictionary dictionary,
240  int* value);
241 
248 MAMAExpDLL
249 extern mama_status
251  mamaDictionary dictionary,
252  const mamaMsg msg );
253 
264 MAMAExpDLL
265 extern mama_status
267  mamaDictionary dictionary,
268  mamaMsg* msg);
269 
282 MAMAExpDLL
283 extern mama_status
285  mamaDictionary dictionary,
286  mama_fid_t fid,
287  const char* name,
288  mamaFieldType type,
289  mamaFieldDescriptor* descriptor);
290 
306 MAMAExpDLL
307 extern mama_status
309  mamaDictionary dictionary,
310  mama_size_t maxFid);
311 
322 MAMAExpDLL
323 extern mama_status
325  mamaDictionary dictionary,
326  const char* fileName);
327 
338 MAMAExpDLL
339 extern mama_status
341  mamaDictionary dictionary,
342  const char* fileName);
343 
344 #if defined (__cplusplus)
345 }
346 #endif
347 
348 #endif /* MamaDictionaryH__ */
struct mamaSourceImpl_ * mamaSource
Definition: types.h:116
A structure containing the callbacks for dictionary creation.
Definition: dictionary.h:58
MAMAExpDLL mama_status mamaDictionary_populateFromFile(mamaDictionary dictionary, const char *fileName)
Populate a dictionary from the contents of a file.
MAMAExpDLL mama_status mamaDictionary_createFieldDescriptor(mamaDictionary dictionary, mama_fid_t fid, const char *name, mamaFieldType type, mamaFieldDescriptor *descriptor)
Create a new field descriptor and add it to the dictionary.
mamaDictionary_completeCallback onComplete
Definition: dictionary.h:60
void(MAMACALLTYPE * mamaDictionary_timeoutCallback)(mamaDictionary, void *)
Definition: dictionary.h:50
MAMAExpDLL mama_status mama_createDictionary(mamaDictionary *dictionary, mamaQueue queue, mamaDictionaryCallbackSet dictionaryCallbacks, mamaSource source, double timeout, int retries, void *closure)
Create a data dictionary from a subscription.
MAMAExpDLL mama_status mamaDictionary_create(mamaDictionary *dictionary)
Create an empty mamaDictionary so that can be populated at a later stage via a call to buildDictionar...
const char mamaFtState void * closure
Definition: ft.h:54
mamaSource source
Definition: sourceman.h:38
MAMAExpDLL mama_status mamaDictionary_writeToFile(mamaDictionary dictionary, const char *fileName)
Write the data dictionary to a file.
mamaDictionary_errorCallback onError
Definition: dictionary.h:62
struct mamaFieldDescriptorImpl_ * mamaFieldDescriptor
Definition: types.h:110
MAMAExpDLL mama_status mamaDictionary_getFeedHost(mamaDictionary dictionary, const char **result)
Return the dictionary source feed host.
MAMAExpDLL mama_status mamaDictionary_hasDuplicates(mamaDictionary dictionary, int *value)
Return true if there are multiple fields with the same name.
struct mamaQueueImpl_ * mamaQueue
Definition: types.h:107
struct mamaDictionaryCallbackSet mamaDictionaryCallbackSet
A structure containing the callbacks for dictionary creation.
uint16_t mama_fid_t
Definition: types.h:46
struct mamaDictionaryImpl_ * mamaDictionary
Definition: types.h:102
MAMAExpDLL mama_status mamaDictionary_getMaxFid(mamaDictionary dictionary, mama_fid_t *value)
Return the highest field identifier.
MAMAExpDLL mama_status mamaDictionary_buildDictionaryFromMessage(mamaDictionary dictionary, const mamaMsg msg)
Build a data dictionary from the specified message.
mamaMsg msg
Definition: publisher.h:54
MAMAExpDLL mama_status mamaDictionary_getSize(mamaDictionary dictionary, size_t *value)
Return the number of fields in the dictionary.
MAMAExpDLL mama_status mamaDictionary_destroy(mamaDictionary dictionary)
Destroy this mamaDictionary object and free all its resources.
size_t size
Definition: queue.h:46
struct mamaMsgImpl_ * mamaMsg
Opaque definitions for all major MAMA data types.
Definition: types.h:95
MAMAExpDLL mama_status mamaDictionary_getFieldDescriptorByIndex(mamaDictionary dictionary, mamaFieldDescriptor *result, unsigned short index)
Return the field with the corresponding zero based index.
enum mamaFieldType_ mamaFieldType
The mamaFieldDescriptor class represents a field in a mamaMsg.
mama_status
Definition: status.h:37
mamaDictionary_timeoutCallback onTimeout
Definition: dictionary.h:61
void(MAMACALLTYPE * mamaDictionary_completeCallback)(mamaDictionary, void *)
The mamaDictionary class maps field identifiers (FIDs) to human readable strings. ...
Definition: dictionary.h:48
size_t mama_size_t
Definition: types.h:47
MAMAExpDLL mama_status mamaDictionary_setMaxFid(mamaDictionary dictionary, mama_size_t maxFid)
Tell the dictionary what the probable maximum fid in the data dictionary may be.
MAMAExpDLL mama_status mamaDictionary_getFieldDescriptorByFid(mamaDictionary dictionary, mamaFieldDescriptor *result, mama_fid_t fid)
Return the mamaFieldDescriptor with the specified field FID.
MAMAExpDLL mama_status mamaDictionary_getFieldDescriptorByNameAll(mamaDictionary dictionary, const char *fname, mamaFieldDescriptor *descList, size_t *size)
Return an array of mamaFieldDescriptor which includes every field in the dictionary with the specifie...
MAMAExpDLL mama_status mamaDictionary_getFeedName(mamaDictionary dictionary, const char **result)
Return the dictionary source feed name.
typedef void(MAMACALLTYPE *mamaFtMemberOnFtStateChangeCb)(mamaFtMember ftMember
Callback function type for MAMA fault tolerance events.
void(MAMACALLTYPE * mamaDictionary_errorCallback)(mamaDictionary, const char *, void *)
Definition: dictionary.h:52
MAMAExpDLL mama_status mamaDictionary_getDictionaryMessage(mamaDictionary dictionary, mamaMsg *msg)
Get the underlying message for the data dictionary.
MAMAExpDLL mama_status mamaDictionary_getFieldDescriptorByName(mamaDictionary dictionary, mamaFieldDescriptor *result, const char *fname)
Return the descriptor of the field with the specified name.


© 2012 Linux Foundation