Drake
LcmTranslatorDictionary Class Reference

A dictionary that maps between LCM channel names and translators that convert between LCM message objects and VectorBase objects. More...

#include <drake/systems/lcm/lcm_translator_dictionary.h>

Public Member Functions

 LcmTranslatorDictionary ()
 The constructor. More...
 
void AddEntry (const std::string &channel_name, std::unique_ptr< const LcmAndVectorBaseTranslator > translator)
 Adds a translator this dictionary. More...
 
bool HasTranslator (const std::string &channel_name) const
 Returns true if and only if a translator for channel_name exists in the dictionary. More...
 
const LcmAndVectorBaseTranslatorGetTranslator (const std::string &channel_name) const
 Returns a reference to the translator to use with the specified channel. More...
 
Does not allow copy, move, or assignment
 LcmTranslatorDictionary (const LcmTranslatorDictionary &)=delete
 
LcmTranslatorDictionaryoperator= (const LcmTranslatorDictionary &)=delete
 
 LcmTranslatorDictionary (LcmTranslatorDictionary &&)=delete
 
LcmTranslatorDictionaryoperator= (LcmTranslatorDictionary &&)=delete
 

Detailed Description

A dictionary that maps between LCM channel names and translators that convert between LCM message objects and VectorBase objects.

All translators contained within the dictionary are guaranteed to remain in existence throughout the lifespan of this object.

Constructor & Destructor Documentation

The constructor.

The dictionary is initially empty.

Here is the call graph for this function:

Member Function Documentation

void AddEntry ( const std::string &  channel_name,
std::unique_ptr< const LcmAndVectorBaseTranslator translator 
)

Adds a translator this dictionary.

Parameters
[in]channel_nameThe name of the LCM channel. Messages sent on and received from this channel are assumed to be compatible with translator.
[in]translatorA pointer to the translator to use with the LCM channel.
Exceptions
std::runtime_errorIf a translator for the channel_name is already in the dictionary.

Here is the call graph for this function:

Here is the caller graph for this function:

const LcmAndVectorBaseTranslator & GetTranslator ( const std::string &  channel_name) const

Returns a reference to the translator to use with the specified channel.

This reference is guaranteed to remain valid for the lifetime of this dictionary.

Exceptions
std::runtime_errorif a translator for channel_name does not exist in this dictionary.

Here is the call graph for this function:

Here is the caller graph for this function:

bool HasTranslator ( const std::string &  channel_name) const

Returns true if and only if a translator for channel_name exists in the dictionary.

Here is the caller graph for this function:

LcmTranslatorDictionary& operator= ( const LcmTranslatorDictionary )
delete

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