Loading...
Searching...
No Matches
lcm::Subscription Class Reference
C++ API Reference

Represents a channel subscription, and can be used to unsubscribe and set options. More...

`#include <lcm/lcm-cpp.hpp>`

## Public Member Functions

int | setQueueCapacity (int num_messages)
| Adjusts the maximum number of received messages that can be queued up for this subscription.
int | getQueueSize () const
| Query the current number of unhandled messages queued up for this subscription.

## Protected Attributes

lcm_subscription_t * | c_subs
std::string | channel_buf

## Friends

class | LCM

## Detailed Description

Represents a channel subscription, and can be used to unsubscribe and set options.

This class is not meant to be instantiated by the user, and instead is constructed and returned by a call to LCM::subscribe() or LCM::subscribeFunction().

To unsubscribe, pass the instance to LCM::unsubscribe(). Once unsubscribed, the object is destroyed and can not be used anymore.

## Member Function Documentation

## setQueueCapacity()

int lcm::Subscription::setQueueCapacity | ( | int | num_messages | ) |

inline

Adjusts the maximum number of received messages that can be queued up for this subscription.

Parameters

  num_messages | the maximum queue size, in messages. The default is 30.

Setting this to a low number may reduce overall latency at the expense of dropping more messages. Conversely, setting this to a high number may drop fewer messages at the expense of increased latency. A value of 0 indicates no limit, and should be used very carefully.

## Member Data Documentation

## c_subs

lcm_subscription_t* lcm::Subscription::c_subs

protected

The underlying lcm_subscription_t object wrapped by this subscription.

The documentation for this class was generated from the following file:

- lcm-cpp.hpp