Drake
DrakeLcmInterface Class Referenceabstract

A pure virtual interface that enables LCM to be mocked. More...

#include <drake/lcm/drake_lcm_interface.h>

Inheritance diagram for DrakeLcmInterface:
[legend]

Public Types

using HandlerFunction = std::function< void(const void *, int)>
 A callback used by DrakeLcmInterface::Subscribe(), with arguments: More...
 

Public Member Functions

virtual ~DrakeLcmInterface ()=default
 
virtual void Publish (const std::string &channel, const void *data, int data_size, optional< double > time_sec)=0
 Publishes an LCM message on channel channel. More...
 
virtual void Subscribe (const std::string &channel, HandlerFunction)=0
 Subscribes to an LCM channel without automatic message decoding. More...
 
virtual void Subscribe (const std::string &channel, DrakeLcmMessageHandlerInterface *)=0
 A deprecated overload of Subscribe. More...
 
Does not allow copy, move, or assignment
 DrakeLcmInterface (const DrakeLcmInterface &)=delete
 
DrakeLcmInterfaceoperator= (const DrakeLcmInterface &)=delete
 
 DrakeLcmInterface (DrakeLcmInterface &&)=delete
 
DrakeLcmInterfaceoperator= (DrakeLcmInterface &&)=delete
 

Protected Member Functions

 DrakeLcmInterface ()=default
 

Detailed Description

A pure virtual interface that enables LCM to be mocked.

Member Typedef Documentation

using HandlerFunction = std::function<void(const void*, int)>

A callback used by DrakeLcmInterface::Subscribe(), with arguments:

  • message_buffer A pointer to the byte vector that is the serial representation of the LCM message.
  • message_size The size of message_buffer.

Constructor & Destructor Documentation

DrakeLcmInterface ( const DrakeLcmInterface )
delete
virtual ~DrakeLcmInterface ( )
virtualdefault
DrakeLcmInterface ( )
protecteddefault

Member Function Documentation

DrakeLcmInterface& operator= ( const DrakeLcmInterface )
delete
DrakeLcmInterface& operator= ( DrakeLcmInterface &&  )
delete
virtual void Publish ( const std::string &  channel,
const void *  data,
int  data_size,
optional< double time_sec 
)
pure virtual

Publishes an LCM message on channel channel.

Parameters
[in]channelThe channel on which to publish the message. Must not be the empty string.
[in]dataA buffer containing the serialized bytes of the message to publish.
[in]data_sizeThe length of in bytes.
[in]time_secTime in seconds when the publish event occurred. If unknown, use drake::nullopt or a default-constructed optional.

Implemented in DrakeLcm, DrakeLcmLog, and DrakeMockLcm.

Here is the caller graph for this function:

virtual void Subscribe ( const std::string &  channel,
HandlerFunction   
)
pure virtual

Subscribes to an LCM channel without automatic message decoding.

The handler will be invoked when a message arrives on channel channel.

Parameters
channelThe channel to subscribe to. Must not be the empty string.

Implemented in DrakeMockLcm, DrakeLcm, and DrakeLcmLog.

Here is the caller graph for this function:

virtual void Subscribe ( const std::string &  channel,
DrakeLcmMessageHandlerInterface *   
)
pure virtual

A deprecated overload of Subscribe.

Implemented in DrakeMockLcm, DrakeLcm, and DrakeLcmLog.


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