LCM .NET API
Classes | Public Member Functions | Properties | List of all members
LCM.LCM.MessageAggregator Class Reference

Accumulates received LCM messages in a queue. More...

Inheritance diagram for LCM.LCM.MessageAggregator:
LCM.LCM.LCMSubscriber

Classes

class  Message
 A received message. More...
 

Public Member Functions

void MessageReceived (LCM lcm, string channel, LCMDataInputStream dins)
 Internal method, called by LCM when a message is received. More...
 
Message GetNextMessage (long timeoutMs)
 Attempt to retrieve the next received LCM message. More...
 
Message GetNextMessage ()
 Retrieves the next message, waiting if necessary. More...
 

Properties

long MaxBufferSize [get, set]
 Retrieves and sets the maximum amount of memory that will be used to store messages. This is an alternative way to limit the messages stored by the aggregator. Messages are discarded oldest-first to ensure that the total size of unretrieved messages stays under this limit. More...
 
int MaxMessages [get, set]
 Retrieves and sets the maximum number of unretrieved message that will be queued up by the aggregator. Messages are discarded oldest-first to ensure that the number of unretrieved messages stays under this limit. More...
 
int MessagesAvailable [get]
 The number of received messages waiting to be retrieved. More...
 

Detailed Description

Accumulates received LCM messages in a queue.

LCM normally delivers messages asynchronously by invoking the messageReceived method on a subscriber as soon as a message is received. This class provides an alternate way to receive messages by storing them in an internal queue, and then delivering them to synchronously to the user.

The aggregator has configurable limits. If too many messages are aggregated without having been retrieved, then older messages are discarded.

Member Function Documentation

◆ GetNextMessage() [1/2]

Message LCM.LCM.MessageAggregator.GetNextMessage ( )
inline

Retrieves the next message, waiting if necessary.

◆ GetNextMessage() [2/2]

Message LCM.LCM.MessageAggregator.GetNextMessage ( long  timeoutMs)
inline

Attempt to retrieve the next received LCM message.

Parameters
timeout_msMax # of milliseconds to wait for a message. If 0, then don't wait. If less than 0, then wait indefinitely.
Returns
a Message, or null if no message was received.

◆ MessageReceived()

void LCM.LCM.MessageAggregator.MessageReceived ( LCM  lcm,
string  channel,
LCMDataInputStream  dins 
)
inline

Internal method, called by LCM when a message is received.

Implements LCM.LCM.LCMSubscriber.

Property Documentation

◆ MaxBufferSize

long LCM.LCM.MessageAggregator.MaxBufferSize
getset

Retrieves and sets the maximum amount of memory that will be used to store messages. This is an alternative way to limit the messages stored by the aggregator. Messages are discarded oldest-first to ensure that the total size of unretrieved messages stays under this limit.

Parameters
valmemory limit, in bytes.

◆ MaxMessages

int LCM.LCM.MessageAggregator.MaxMessages
getset

Retrieves and sets the maximum number of unretrieved message that will be queued up by the aggregator. Messages are discarded oldest-first to ensure that the number of unretrieved messages stays under this limit.

◆ MessagesAvailable

int LCM.LCM.MessageAggregator.MessagesAvailable
get

The number of received messages waiting to be retrieved.


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