#include <MamaDictionary.h>
Name | |
---|---|
virtual | ~MamaDictionary() |
MamaDictionary(void ) | |
virtual void | create(MamaQueue * queue, MamaDictionaryCallback * callback, MamaSource * source, int retries =MAMA_DEFAULT_RETRIES, double timeout =MAMA_DEFAULT_TIMEOUT, void * closure =NULL) |
virtual const char * | getFeedName() |
virtual const char * | getFeedHost() |
virtual MamaFieldDescriptor * | getFieldByFid(mama_fid_t fid) |
virtual const MamaFieldDescriptor * | getFieldByFid(mama_fid_t fid) const |
virtual MamaFieldDescriptor * | getFieldByIndex(size_t index) |
virtual const MamaFieldDescriptor * | getFieldByIndex(size_t index) const |
virtual MamaFieldDescriptor * | getFieldByName(const char * name) |
virtual const MamaFieldDescriptor * | getFieldByName(const char * name) const |
virtual mama_fid_t | getMaxFid(void ) const |
virtual size_t | getSize(void ) const |
virtual bool | hasDuplicates(void ) const |
virtual MamaDictionaryCallback * | getCallback(void ) const |
virtual void | setCallback(MamaDictionaryCallback * callback) |
virtual mamaDictionary | getDictC() |
virtual const mamaDictionary | getDictC() const |
virtual void * | getClosure(void ) const |
virtual MamaMsg * | getDictionaryMessage() const |
virtual void | buildDictionaryFromMessage(MamaMsg & msg) |
virtual MamaFieldDescriptor * | createFieldDescriptor(mama_fid_t fid, const char * name, mamaFieldType type) |
virtual void | setMaxFid(mama_size_t maxFid) |
virtual void | writeToFile(const char * fileName) |
virtual void | populateFromFile(const char * fileName) |
Name | |
---|---|
DictionaryImpl * | mPimpl |
class Wombat::MamaDictionary;
The [MamaDictionary](classWombat_1_1MamaDictionary.html)
class maps field identifiers (FIDs) to human readable strings. Incoming [MamaMsg](classWombat_1_1MamaMsg.html)
s may contain FIDs but no field names. The dictionary allows applications to determine the name associated with a given FID. On some platforms, the inbound messages may have names, but not fids in which case the dictionary can map names to fids.
virtual ~MamaDictionary()
MamaDictionary(
void
)
virtual void create(
MamaQueue * queue,
MamaDictionaryCallback * callback,
MamaSource * source,
int retries =MAMA_DEFAULT_RETRIES,
double timeout =MAMA_DEFAULT_TIMEOUT,
void * closure =NULL
)
Parameters:
Create a dictionary subscription. The caller supplied DictionaryCallback.onComplete
will be invoked after the dictionary is fully constructed.
If there is an error creating the dictionary Mama invokes the onError
callback, and the returned dictionary is not valid. In the event of a timeout, Mama invokes the onTimeout
callback. This method uses the default timeout and retry values (SubscriptionBridge.DEFAULT_TIMEOUT
and SubscriptionBridge.DEFAULT_RETRIES
.
virtual const char * getFeedName()
Parameters:
Return: the feed name
Return the dictionary source feed name
virtual const char * getFeedHost()
Parameters:
Return: the feed host
Return the dictionary source feed host
virtual MamaFieldDescriptor * getFieldByFid(
mama_fid_t fid
)
Parameters:
Return: The field.
Return the field with the specified field FID. This method is very efficient.
virtual const MamaFieldDescriptor * getFieldByFid(
mama_fid_t fid
) const
Parameters:
Return: The field.
Return the field with the specified field FID. This method is very efficient.
virtual MamaFieldDescriptor * getFieldByIndex(
size_t index
)
Parameters:
Return: The field.
Return the field with the corresponding zero based index. This method is O (N) with respect to the size of the dictionary.
virtual const MamaFieldDescriptor * getFieldByIndex(
size_t index
) const
Parameters:
Return: The field.
Return the field with the corresponding zero based index. This method is O (N) with respect to the size of the dictionary.
virtual MamaFieldDescriptor * getFieldByName(
const char * name
)
Parameters:
Return: The field with the specified name or null if there is no such field.
Return the field with the specified name. If there is more than one field with the same name, the one with the lowest field id is returned.
virtual const MamaFieldDescriptor * getFieldByName(
const char * name
) const
Parameters:
Return: The field with the specified name or null if there is no such field.
Return the field with the specified name. If there is more than one field with the same name, the one with the lowest field id is returned.
virtual mama_fid_t getMaxFid(
void
) const
Return: The highest FID.
Return the highest field identifier.
virtual size_t getSize(
void
) const
Return: The number of entries in the dictionary.
Return the number of fields in the dictionary.
virtual bool hasDuplicates(
void
) const
Return: true if there are duplicates.
Return true if there are multiple fields with the same name.
virtual MamaDictionaryCallback * getCallback(
void
) const
Return: The callback
Return the callback.
virtual void setCallback(
MamaDictionaryCallback * callback
)
Parameters:
Set the callback to receive notifications when creation is complete or an error occurs.
virtual mamaDictionary getDictC()
Return the underlying C mamaDictionary.
virtual const mamaDictionary getDictC() const
Return the underlying C mamaDictionary.
virtual void * getClosure(
void
) const
Return: the closure.
Return the closure for the dictionary.
virtual MamaMsg * getDictionaryMessage() const
Return: Pointer to a new MamaMsg for the dictionary.
Returns a MamaMsg representing the data dictionary. This message can be published or used to create a new MamaDictionary object. A new MamaMsg is created for each invocation of the method. It is the responsibility of the caller to delete the message when no longer needed.
virtual void buildDictionaryFromMessage(
MamaMsg & msg
)
Parameters:
Recreate a data dictionary from the MamaMsg supplied. The MamaMsg is copied and can therefore be deleted after the method has returned.
virtual MamaFieldDescriptor * createFieldDescriptor(
mama_fid_t fid,
const char * name,
mamaFieldType type
)
Parameters:
Add a new field descriptor to a dictionary. New fields can be added to an existing dictionary obtained from the MAMA infrastructure. This function can also be used to manually build a data dictionary.
virtual void setMaxFid(
mama_size_t maxFid
)
Parameters:
Tell the dictionary what the probable maximum fid in the data dictionary may be. This is not necessary but will aid performance for manually creating a new dictionary or adding new fields to an existing dictionary.
Calling this function ensures that there is capacity in the dictionary for field descriptors with fids up to the maximum specified.
Fields with fids greater than specified can be added to the dictionary but this will incur the overhead of allocating more memory and copying dictionary elements.
virtual void writeToFile(
const char * fileName
)
Parameters:
Write the data dictionary to a file. The dictionary will be written in the form: fid | fieldName | fieldType |
virtual void populateFromFile(
const char * fileName
)
Parameters:
Populate a dictionary from the contents of a file. Can be used to add additional fields to an existing dictionary or to populate a new dictionary.
DictionaryImpl * mPimpl;
Updated on 2023-03-31 at 15:29:25 +0100