Function rmw_get_gid_for_publisher
Defined in File rmw.h
Function Documentation
-
rmw_ret_t rmw_get_gid_for_publisher(const rmw_publisher_t *publisher, rmw_gid_t *gid)
Get the unique identifier (gid) of a publisher.
Attribute
Adherence
Allocates Memory
No
Thread-Safe
Yes
Uses Atomics
Maybe [1]
Lock-Free
Maybe [1]
[1] implementation defined, check implementation documentation.
- Thread-safety
Publishers are thread-safe objects, and so are all operations on them except for finalization. Therefore, it is safe to get the unique identifier from the same publisher concurrently. However, access to the gid is not synchronized. It is not safe to read or write
gidwhile rmw_get_gid_for_publisher() uses it.
- Parameters:
publisher – [in] Publisher to get a gid from.
gid – [out] Publisher’s unique identifier, populated on success but left unchanged on failure.
- Pre:
Given
publishermust be a valid publisher, as returned by rmw_create_publisher().- Returns:
RMW_RET_OKif successful, or- Returns:
RMW_RET_INVALID_ARGUMENTifpublisheris NULL, or- Returns:
RMW_RET_INVALID_ARGUMENTifgidis NULL, or- Returns:
RMW_RET_INCORRECT_RMW_IMPLEMENTATIONif thepublisherimplementation identifier does not match this implementation, or- Returns:
RMW_RET_ERRORif an unspecified error occurs.