rmw  master
C API providing a middleware abstraction layer which is used to implement the rest of ROS.
Classes | Typedefs | Functions
topic_endpoint_info.h File Reference
#include "rcutils/allocator.h"
#include "rmw/types.h"
#include "rmw/visibility_control.h"
Include dependency graph for topic_endpoint_info.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rmw_topic_endpoint_info_t
 

Typedefs

typedef struct RMW_PUBLIC_TYPE rmw_topic_endpoint_info_t rmw_topic_endpoint_info_t
 

Functions

rmw_topic_endpoint_info_t rmw_get_zero_initialized_topic_endpoint_info (void)
 Return a rmw_topic_endpoint_info_t struct with members initialized to NULL. More...
 
rmw_ret_t rmw_topic_endpoint_info_fini (rmw_topic_endpoint_info_t *topic_endpoint_info, rcutils_allocator_t *allocator)
 Finalize a rmw_topic_endpoint_info_t object. More...
 
rmw_ret_t rmw_topic_endpoint_info_set_topic_type (rmw_topic_endpoint_info_t *topic_endpoint_info, const char *topic_type, rcutils_allocator_t *allocator)
 Set the topic_type in rmw_topic_endpoint_info_t. More...
 
rmw_ret_t rmw_topic_endpoint_info_set_node_name (rmw_topic_endpoint_info_t *topic_endpoint_info, const char *node_name, rcutils_allocator_t *allocator)
 Set the node_name in rmw_topic_endpoint_info_t. More...
 
rmw_ret_t rmw_topic_endpoint_info_set_node_namespace (rmw_topic_endpoint_info_t *topic_endpoint_info, const char *node_namespace, rcutils_allocator_t *allocator)
 Set the node_namespace in rmw_topic_endpoint_info_t. More...
 
rmw_ret_t rmw_topic_endpoint_info_set_endpoint_type (rmw_topic_endpoint_info_t *topic_endpoint_info, rmw_endpoint_type_t type)
 Set the gid in rmw_topic_endpoint_info_t. More...
 
rmw_ret_t rmw_topic_endpoint_info_set_gid (rmw_topic_endpoint_info_t *topic_endpoint_info, const uint8_t gid[], size_t size)
 Set the gid in rmw_topic_endpoint_info_t. More...
 
rmw_ret_t rmw_topic_endpoint_info_set_qos_profile (rmw_topic_endpoint_info_t *topic_endpoint_info, const rmw_qos_profile_t *qos_profile)
 Set the qos_profile in rmw_topic_endpoint_info_t. More...
 

Typedef Documentation

◆ rmw_topic_endpoint_info_t

A structure that encapsulates the name, namespace, topic_type, gid and qos_profile of publishers and subscriptions for a topic.

Function Documentation

◆ rmw_get_zero_initialized_topic_endpoint_info()

rmw_topic_endpoint_info_t rmw_get_zero_initialized_topic_endpoint_info ( void  )

Return a rmw_topic_endpoint_info_t struct with members initialized to NULL.

◆ rmw_topic_endpoint_info_fini()

rmw_ret_t rmw_topic_endpoint_info_fini ( rmw_topic_endpoint_info_t topic_endpoint_info,
rcutils_allocator_t allocator 
)

Finalize a rmw_topic_endpoint_info_t object.

The rmw_topic_endpoint_info_t struct has members which require memory to be allocated to them before setting values. This function reclaims any allocated resources within the object and zeroes out all other members.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infoobject to be finalized
[in]allocatorthe allocator used to allocate memory to the object
Returns
RMW_RET_OK on successfully reclaiming memory, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_set_topic_type()

rmw_ret_t rmw_topic_endpoint_info_set_topic_type ( rmw_topic_endpoint_info_t topic_endpoint_info,
const char *  topic_type,
rcutils_allocator_t allocator 
)

Set the topic_type in rmw_topic_endpoint_info_t.

rmw_topic_endpoint_info_t has a member topic_type of type const char *; this function allocates memory and copies the value of param passed to it.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infopointer to an initialized instance of rmw_topic_endpoint_info_t
[in]topic_typethe topic_type value to set in rmw_topic_endpoint_info_t
[in]allocatorthe allocator that will be used to allocate memory
Returns
RMW_RET_OK on successfully setting the topic_type, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_set_node_name()

rmw_ret_t rmw_topic_endpoint_info_set_node_name ( rmw_topic_endpoint_info_t topic_endpoint_info,
const char *  node_name,
rcutils_allocator_t allocator 
)

Set the node_name in rmw_topic_endpoint_info_t.

rmw_topic_endpoint_info_t has a member node_name of type const char *; this function allocates memory and copies the value of param passed to it.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infopointer to an initialized instance of rmw_topic_endpoint_info_t
[in]node_namethe node_name value to set in rmw_topic_endpoint_info_t
[in]allocatorthe allocator that will be used to allocate memory
Returns
RMW_RET_OK on successfully setting the node_name, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_set_node_namespace()

rmw_ret_t rmw_topic_endpoint_info_set_node_namespace ( rmw_topic_endpoint_info_t topic_endpoint_info,
const char *  node_namespace,
rcutils_allocator_t allocator 
)

Set the node_namespace in rmw_topic_endpoint_info_t.

rmw_topic_endpoint_info_t has a member node_namespace of type const char *; this function allocates memory and copies the value of param passed to it.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infopointer to an initialized instance of rmw_topic_endpoint_info_t
[in]node_namespacethe node_namespace value to set in rmw_topic_endpoint_info_t
[in]allocatorthe allocator that will be used to allocate memory
Returns
RMW_RET_OK on successfully setting the node_namespace, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_set_endpoint_type()

rmw_ret_t rmw_topic_endpoint_info_set_endpoint_type ( rmw_topic_endpoint_info_t topic_endpoint_info,
rmw_endpoint_type_t  type 
)

Set the gid in rmw_topic_endpoint_info_t.

Copies the values from gid into the gid member inside topic_endpoint_info.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infopointer to an initialized instance of rmw_topic_endpoint_info_t
[in]gidthe gid value to set in rmw_topic_endpoint_info_t
[in]sizethe size of the gid param
Returns
RMW_RET_OK on successfully setting the gid, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_INVALID_ARGUMENT size is greater than RMW_GID_STORAGE_SIZE, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_set_gid()

rmw_ret_t rmw_topic_endpoint_info_set_gid ( rmw_topic_endpoint_info_t topic_endpoint_info,
const uint8_t  gid[],
size_t  size 
)

Set the gid in rmw_topic_endpoint_info_t.

Copies the values from gid into the gid member inside topic_endpoint_info.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infopointer to an initialized instance of rmw_topic_endpoint_info_t
[in]gidthe gid value to set in rmw_topic_endpoint_info_t
[in]sizethe size of the gid param
Returns
RMW_RET_OK on successfully setting the gid, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_INVALID_ARGUMENT size is greater than RMW_GID_STORAGE_SIZE, or
RMW_RET_ERROR when an unspecified error occurs.

◆ rmw_topic_endpoint_info_set_qos_profile()

rmw_ret_t rmw_topic_endpoint_info_set_qos_profile ( rmw_topic_endpoint_info_t topic_endpoint_info,
const rmw_qos_profile_t qos_profile 
)

Set the qos_profile in rmw_topic_endpoint_info_t.

rmw_topic_endpoint_info_t has a member qos_profile of type const rmw_qos_profile_t *. This function assigns the passed qos_profile pointer to the member.

If a non RMW_RET_OK return value is returned, the RMW error message will be set

Parameters
[in,out]topic_endpoint_infopointer to an initialized instance of rmw_topic_endpoint_info_t
[in]qos_profilethe qos_profile to set in rmw_topic_endpoint_info_t
Returns
RMW_RET_OK on successfully setting the qos_profile, or
RMW_RET_INVALID_ARGUMENT if any parameters are NULL, or
RMW_RET_ERROR when an unspecified error occurs.