Go to the documentation of this file.
39 #include <boost/bind/bind.hpp>
45 : writing_message_(false)
46 , header_written_(false)
69 if (!
header.getValue(
"topic", topic))
71 std::string msg(
"Header from subscriber did not have the required element: topic");
80 std::string client_callerid;
81 header.getValue(
"callerid", client_callerid);
85 std::string msg = std::string(
"received a connection for a nonexistent topic [") +
86 topic + std::string(
"] from [" +
connection_->getTransport()->getTransportInfo() +
"] [" + client_callerid +
"].");
94 std::string error_msg;
95 if (!pt->validateHeader(
header, error_msg))
110 m[
"type"] = pt->getDataType();
111 m[
"md5sum"] = pt->getMD5Sum();
112 m[
"message_definition"] = pt->getMessageDefinition();
114 m[
"latching"] = pt->isLatching() ?
"1" :
"0";
118 pt->addSubscriberLink(shared_from_this());
134 parent->removeSubscriberLink(shared_from_this());
192 max_queue = parent->getMaxQueue();
197 if (max_queue > 0 && (
int)
outbox_.size() >= max_queue)
201 ROS_DEBUG(
"Outgoing queue full for topic [%s]. "
202 "Discarding oldest message",
231 return connection_->getTransport()->getTransportInfo();
uint64_t message_data_sent_
void onHeaderWritten(const ConnectionPtr &conn)
#define ROSCPP_CONN_LOG_DEBUG(...)
unsigned int connection_id_
std::queue< SerializedMessage > outbox_
virtual ~TransportSubscriberLink()
std::string destination_caller_id_
TransportSubscriberLink()
boost::mutex outbox_mutex_
boost::weak_ptr< Publication > PublicationWPtr
#define ROS_DEBUG_NAMED(name,...)
void onConnectionDropped(const ConnectionPtr &conn)
boost::signals2::connection dropped_conn_
bool initialize(const ConnectionPtr &connection)
const ROSCPP_DECL std::string & getName()
Returns the name of the current node.
ConnectionPtr connection_
static const TopicManagerPtr & instance()
virtual std::string getTransportType()
static const ConnectionManagerPtr & instance()
void onMessageWritten(const ConnectionPtr &conn)
virtual std::string getTransportInfo()
bool handleHeader(const Header &header)
virtual void enqueueMessage(const SerializedMessage &m, bool ser, bool nocopy)
Queue up a message for publication. Throws out old messages if we've reached our Publication's max qu...
#define ROSCPP_LOG_DEBUG(...)
boost::shared_array< uint8_t > buf
std::map< std::string, std::string > M_string
void startMessageWrite(bool immediate_write)
roscpp
Author(s): Morgan Quigley, Josh Faust, Brian Gerkey, Troy Straszheim, Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:36