pips_multimap_t

Updated: April 19, 2023

PiPS multimap

Synopsis:

#include <pips/multimap.h>
typedef struct pips_multimap {
    size_t num_items;
    pips_multimap_item_t* first;
} pips_multimap_t;

Data:

size_t num_items
The number of items (mappings) contained in the multimap
pips_multimap_item_t* first
The first item in the multimap

Library:

pips-client

Description:

This data type is the CSTRUCT encoding of the MultiMap built-in PiPS data type. The multimap container is unordered, and each item has an associated key that must be unique to the pips_multimap_t instance.

The C structure type and its associated functions let clients use the MultiMap data type without having to encode data in PPS. This is helpful when interacting with Number or BLOB fields because the client doesn't have to translate them from string data to double or octet-array data.

Note: After reading a pips_multimap_t instance from a publication, the client must iterate through the multimap items and delete the memory for each item before deleting the memory for the multimap structure itself. Otherwise, the memory for the items will be leaked. This is because publications don't allocate pips_multimap_t instances as contiguous memory buffers. This behavior differs from that of the other built-in data types.