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)


A pointer to the namespace from which to collect topics
A pointer to the group to which the topics will be added. If this argument is NULL, the topics that would otherwise be added will be counted.
The maximum depth that the function should search to in the current namespace. If this value is negative, the search will be unbounded. If it's zero, the function won't search recursively, meaning no child entities that are namespaces will be searched.




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.


  • EINVAL: The namespace is invalid.
  • ENOTTY: The given topic instance was not a group.