A publisher of messages on a topic.  
 More...
#include <transport/transport.hh>
|  | 
|  | Publisher (const std::string &_topic, const std::string &_msgType, unsigned int _limit, bool _latch) | 
|  | Constructor. 
 | 
|  | 
| virtual | ~Publisher () | 
|  | Destructor. 
 | 
|  | 
| bool | GetLatching () const | 
|  | Are we latching the latest message? 
 | 
|  | 
| std::string | GetMsgType () const | 
|  | Get the message type. 
 | 
|  | 
| unsigned int | GetOutgoingCount () const | 
|  | Get the number of outgoing messages. 
 | 
|  | 
| std::string | GetPrevMsg () const | 
|  | Get the previously published message. 
 | 
|  | 
| std::string | GetTopic () const | 
|  | Get the topic name. 
 | 
|  | 
| bool | HasConnections () const | 
|  | Are there any connections? 
 | 
|  | 
| void | Publish (const google::protobuf::Message &_message, bool _block=false) | 
|  | Publish a protobuf message on the topic. 
 | 
|  | 
| template<typename M > | 
| void | Publish (M _message, bool _block=false) | 
|  | Publish an arbitrary message on the topic. 
 | 
|  | 
| void | SendMessage () | 
|  | Send latest message over the wire. For internal use only. 
 | 
|  | 
| void | SetPublication (PublicationPtr &_publication, int _i) | 
|  | Set the publication object for a particular publication. 
 | 
|  | 
| void | WaitForConnection () const | 
|  | Block until a connection has been established with this publisher. 
 | 
|  | 
A publisher of messages on a topic. 
      
        
          | gazebo::transport::Publisher::Publisher | ( | const std::string & | _topic, | 
        
          |  |  | const std::string & | _msgType, | 
        
          |  |  | unsigned int | _limit, | 
        
          |  |  | bool | _latch | 
        
          |  | ) |  |  | 
      
 
Constructor. 
- Parameters
- 
  
    | [in] | _topic | Name of topic to be published |  | [in] | _msgType | Type of the message to be published |  | [in] | _limit | Maximum number of outgoing messages to queue |  | [in] | _latch | If true, latch last message; if false, don't latch |  
 
 
 
  
  | 
        
          | virtual gazebo::transport::Publisher::~Publisher | ( |  | ) |  |  | virtual | 
 
 
      
        
          | bool gazebo::transport::Publisher::GetLatching | ( |  | ) | const | 
      
 
Are we latching the latest message? 
- Returns
- true if we latching the latest message, false otherwise 
 
 
      
        
          | std::string gazebo::transport::Publisher::GetMsgType | ( |  | ) | const | 
      
 
Get the message type. 
- Returns
- The message type 
 
 
      
        
          | unsigned int gazebo::transport::Publisher::GetOutgoingCount | ( |  | ) | const | 
      
 
Get the number of outgoing messages. 
- Returns
- The number of outgoing messages 
 
 
      
        
          | std::string gazebo::transport::Publisher::GetPrevMsg | ( |  | ) | const | 
      
 
Get the previously published message. 
- Returns
- The previously published message, if any 
 
 
      
        
          | std::string gazebo::transport::Publisher::GetTopic | ( |  | ) | const | 
      
 
Get the topic name. 
- Returns
- The topic name 
 
 
      
        
          | bool gazebo::transport::Publisher::HasConnections | ( |  | ) | const | 
      
 
Are there any connections? 
- Returns
- true if there are any connections, false otherwise 
 
 
  
  | 
        
          | void gazebo::transport::Publisher::Publish | ( | const google::protobuf::Message & | _message, |  
          |  |  | bool | _block = false |  
          |  | ) |  |  |  | inline | 
 
Publish a protobuf message on the topic. 
- Parameters
- 
  
    | [in] | _message | Message to be published |  | [in] | _block | Whether to block until the message is actually written out |  
 
 
 
template<typename M > 
  
  | 
        
          | void gazebo::transport::Publisher::Publish | ( | M | _message, |  
          |  |  | bool | _block = false |  
          |  | ) |  |  |  | inline | 
 
Publish an arbitrary message on the topic. 
- Parameters
- 
  
    | [in] | _message | Message to be published |  | [in] | _block | Whether to block until the message is actually written out |  
 
 
 
      
        
          | void gazebo::transport::Publisher::SendMessage | ( |  | ) |  | 
      
 
Send latest message over the wire. For internal use only. 
 
 
      
        
          | void gazebo::transport::Publisher::SetPublication | ( | PublicationPtr & | _publication, | 
        
          |  |  | int | _i | 
        
          |  | ) |  |  | 
      
 
Set the publication object for a particular publication. 
- Parameters
- 
  
    | [in] | _publication | Pointer to the publication object to be set |  | [in] | _i | Index into publications vector that will be set |  
 
 
 
      
        
          | void gazebo::transport::Publisher::WaitForConnection | ( |  | ) | const | 
      
 
Block until a connection has been established with this publisher. 
 
 
The documentation for this class was generated from the following file: