pips_delete_topic()

Updated: May 06, 2022

Delete a topic

Synopsis:

#include <pips/publication.h>
int pips_delete_topic(pips_topic_t **topic)

Arguments:

topic
The address of a pointer to a topic instance to delete

Library:

pips-client

Description:

This function safely deletes the specified topic, which is passed by reference, ensuring that the instance is properly cleaned up in the middleware. This function should be used instead of the standard free() system call to ensure that all system resources are properly cleaned up.

Prerequisites

Any publications created for the topic become invalidated and their behavior undefined when the topic is deleted. This means all local publications for the topic must be deleted before the topic itself is deleted.

Returns:

0
The specified topic was deleted successfully; the pointer whose address is stored in topic has been set to NULL
-1
An error occurred (errno is set)

Errors:

  • EINVAL: The topic is invalid.
  • ENOSYS: The delete object callout was not implemented.