Drake
DrakeMockLcm Class Reference

Detailed Description

An implementation of DrakeLcmInterface that manipulates LCM messages in memory, not on the wire.

Other than the class name, it is identical to a DrakeLcm("memq://"), i.e., an object constructed with the memq provider.

#include <drake/lcm/drake_mock_lcm.h>

Public Member Functions

 DrakeMockLcm ()
 
 ~DrakeMockLcm () override
 
Does not allow copy, move, or assignment
 DrakeMockLcm (const DrakeMockLcm &)=delete
 
DrakeMockLcmoperator= (const DrakeMockLcm &)=delete
 
 DrakeMockLcm (DrakeMockLcm &&)=delete
 
DrakeMockLcmoperator= (DrakeMockLcm &&)=delete
 
- Public Member Functions inherited from DrakeLcm
 DrakeLcm ()
 Constructs using LCM's default URL (either the default hard-coded URL, or else LCM_DEFAULT_URL environment variable if it is set). More...
 
 DrakeLcm (std::string lcm_url)
 Constructs using the given URL. More...
 
 DrakeLcm (std::string lcm_url, bool defer_initialization)
 (Advanced) Constructs using the given URL, but with the ability to defer launching the receive thread. More...
 
 ~DrakeLcm () override
 A destructor that forces the receive thread to be stopped. More...
 
::lcm::LCM * get_lcm_instance ()
 (Advanced.) An accessor to the underlying LCM instance. More...
 
void Publish (const std::string &, const void *, int, std::optional< double >) override
 Most users should use the drake::lcm::Publish() free function, instead of this interface method. More...
 
std::string get_lcm_url () const override
 Returns a URL describing the transport of this LCM interface. More...
 
std::shared_ptr< DrakeSubscriptionInterfaceSubscribe (const std::string &, HandlerFunction) override
 Most users should use the drake::lcm::Subscribe() free function or the drake::lcm::Subscriber wrapper class, instead of this interface method. More...
 
std::shared_ptr< DrakeSubscriptionInterfaceSubscribeAllChannels (MultichannelHandlerFunction) override
 Subscribe to all channels; this is useful for logging and redirecting LCM traffic without regard to its content. More...
 
int HandleSubscriptions (int) override
 Invokes the HandlerFunction callbacks for all subscriptions' pending messages. More...
 
 DrakeLcm (const DrakeLcm &)=delete
 
DrakeLcmoperator= (const DrakeLcm &)=delete
 
 DrakeLcm (DrakeLcm &&)=delete
 
DrakeLcmoperator= (DrakeLcm &&)=delete
 
- Public Member Functions inherited from DrakeLcmInterface
virtual ~DrakeLcmInterface ()
 
 DrakeLcmInterface (const DrakeLcmInterface &)=delete
 
DrakeLcmInterfaceoperator= (const DrakeLcmInterface &)=delete
 
 DrakeLcmInterface (DrakeLcmInterface &&)=delete
 
DrakeLcmInterfaceoperator= (DrakeLcmInterface &&)=delete
 

Additional Inherited Members

- Public Types inherited from DrakeLcmInterface
using HandlerFunction = std::function< void(const void *, int)>
 A callback used by DrakeLcmInterface::Subscribe(), with arguments: More...
 
using MultichannelHandlerFunction = std::function< void(std::string_view, const void *, int)>
 A callback used by DrakeLcmInterface::SubscribeMultipleChannels (which therefore needs the receiving channel passed in). More...
 
- Protected Member Functions inherited from DrakeLcmInterface
 DrakeLcmInterface ()
 

Constructor & Destructor Documentation

◆ DrakeMockLcm() [1/3]

DrakeMockLcm ( const DrakeMockLcm )
delete

◆ DrakeMockLcm() [2/3]

DrakeMockLcm ( DrakeMockLcm &&  )
delete

◆ DrakeMockLcm() [3/3]

◆ ~DrakeMockLcm()

~DrakeMockLcm ( )
override

Member Function Documentation

◆ operator=() [1/2]

DrakeMockLcm& operator= ( const DrakeMockLcm )
delete

◆ operator=() [2/2]

DrakeMockLcm& operator= ( DrakeMockLcm &&  )
delete

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