34 #ifndef ROSBAG_SNAPSHOT_SNAPSHOTTER_H 35 #define ROSBAG_SNAPSHOT_SNAPSHOTTER_H 37 #include <boost/atomic.hpp> 38 #include <boost/thread/mutex.hpp> 39 #include <boost/thread/shared_mutex.hpp> 42 #include <rosbag_snapshot_msgs/TriggerSnapshot.h> 43 #include <std_srvs/SetBool.h> 45 #include <rosgraph_msgs/TopicStatistics.h> 46 #include <rosbag_snapshot_msgs/SnapshotStatus.h> 80 int32_t memory_limit = INHERIT_MEMORY_LIMIT);
97 typedef std::map<std::string, SnapshotterTopicOptions>
topics_t;
105 bool addTopic(std::string
const& topic,
156 void fillStatus(rosgraph_msgs::TopicStatistics& status);
157 typedef std::pair<queue_t::const_iterator, queue_t::const_iterator>
range_t;
170 bool preparePush(int32_t size,
ros::Time const& time);
191 typedef std::map<std::string, boost::shared_ptr<MessageQueue> >
buffers_t;
209 bool postfixFilename(std::string& file);
211 std::string timeAsStr();
220 bool triggerSnapshotCb(rosbag_snapshot_msgs::TriggerSnapshot::Request& req,
221 rosbag_snapshot_msgs::TriggerSnapshot::Response& res);
223 bool enableCB(std_srvs::SetBool::Request& req, std_srvs::SetBool::Response& res);
235 rosbag_snapshot_msgs::TriggerSnapshot::Request& req,
236 rosbag_snapshot_msgs::TriggerSnapshot::Response& res);
272 #endif // ROSBAG_SNAPSHOT_SNAPSHOTTER_H int32_t default_memory_limit_
boost::shared_ptr< ros::M_string > connection_header
boost::shared_ptr< ros::Subscriber > sub_
ros::ServiceServer enable_server_
std::map< std::string, boost::shared_ptr< MessageQueue > > buffers_t
static const int32_t INHERIT_MEMORY_LIMIT
static const ros::Duration NO_DURATION_LIMIT
ros::Duration status_period_
topic_tools::ShapeShifter::ConstPtr msg
boost::upgrade_mutex state_lock_
SnapshotterOptions options_
std::map< std::string, SnapshotterTopicOptions > topics_t
std::pair< queue_t::const_iterator, queue_t::const_iterator > range_t
ros::Duration duration_limit_
SnapshotterTopicOptions options_
std::vector< std::string > topics_
static const int QUEUE_SIZE
ros::Timer poll_topic_timer_
static const ros::Duration INHERIT_DURATION_LIMIT
ros::Duration default_duration_limit_
std::deque< SnapshotMessage > queue_t
class ROSBAG_DECL Snapshotter
ros::ServiceServer trigger_snapshot_server_
static const int32_t NO_MEMORY_LIMIT
ros::Publisher status_pub_