Updated: April 19, 2023 |
Collect a namespace's topics into a given group
#include <pips/publication.h>
int pips_namespace_group_topics(const pips_namespace_t *nmspace, pips_group_t *group, const int max_depth)
This function finds all topics contained in the current namespace and adds them to the given group. The topics can be added recursively, in which case the topics of sub-namespaces will also be added to the group, up to a specified depth. If no group is provided, this function counts the number of topics that would otherwise be added.
On success, the number of topics added to the group, if its capacity is sufficient for them. If its capacity of N is less than the number of topics found, only the first N topics will be added to the group, but the total number of topics found will be returned. On error, this function returns -1 and sets errno.