ZeroMQ by Pieter Hintjens

ZeroMQ by Pieter Hintjens

Author:Pieter Hintjens [Pieter Hintjens]
Language: eng
Format: epub
Tags: COMPUTERS / Programming Languages / C
ISBN: 9781449334048
Publisher: O’Reilly Media
Published: 2013-03-11T16:00:00+00:00


The store method (Example 5-43) stores the key-value message into a hashmap, unless the key and value are both null. It nullifies the kvmsg reference so that the object is owned by the hashmap, not the caller.

Example 5-43. Key-value message class, full (kvmsg.c): store method

void kvmsg_store (kvmsg_t **self_p, zhash_t *hash) { assert (self_p); if (*self_p) { kvmsg_t *self = *self_p; assert (self); if (kvmsg_size (self)) { if (self->present [FRAME_KEY] && self->present [FRAME_BODY]) { zhash_update (hash, kvmsg_key (self), self); zhash_freefn (hash, kvmsg_key (self), kvmsg_free); } } else zhash_delete (hash, kvmsg_key (self)); *self_p = NULL; } }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.