message_instance.cpp
Go to the documentation of this file.
1 // Copyright (c) 2009, Willow Garage, Inc.
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above copyright
10 // notice, this list of conditions and the following disclaimer in the
11 // documentation and/or other materials provided with the distribution.
12 // * Neither the name of Willow Garage, Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived from
14 // this software without specific prior written permission.
15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 // POSSIBILITY OF SUCH DAMAGE.
27 
29 
30 #include "ros/message_event.h"
31 
32 using std::string;
33 using ros::Time;
34 using boost::shared_ptr;
35 
36 namespace rosbag {
37 
38 MessageInstance::MessageInstance(ConnectionInfo const* connection_info, IndexEntry const& index_entry, Bag const& bag) :
39  connection_info_(connection_info), index_entry_(index_entry), bag_(&bag)
40 {
41 }
42 
43 Time const& MessageInstance::getTime() const { return index_entry_.time; }
44 string const& MessageInstance::getTopic() const { return connection_info_->topic; }
45 string const& MessageInstance::getDataType() const { return connection_info_->datatype; }
46 string const& MessageInstance::getMD5Sum() const { return connection_info_->md5sum; }
48 
50 
52  ros::M_string::const_iterator header_iter = connection_info_->header->find("callerid");
53  return header_iter != connection_info_->header->end() ? header_iter->second : string("");
54 }
55 
57  ros::M_string::const_iterator header_iter = connection_info_->header->find("latching");
58  return header_iter != connection_info_->header->end() && header_iter->second == "1";
59 }
60 
61 uint32_t MessageInstance::size() const {
63 }
64 
65 } // namespace rosbag
uint32_t readMessageDataSize(IndexEntry const &index_entry) const
Definition: bag.cpp:871
ConnectionInfo const * connection_info_
IndexEntry const index_entry_
ros::Time time
Definition: structures.h:78
std::string const & getMD5Sum() const
std::string md5sum
Definition: structures.h:54
ros::Time const & getTime() const
uint32_t size() const
Size of serialized message.
std::string msg_def
Definition: structures.h:55
boost::shared_ptr< ros::M_string > getConnectionHeader() const
std::string const & getMessageDefinition() const
std::string datatype
Definition: structures.h:53
boost::shared_ptr< ros::M_string > header
Definition: structures.h:57
Definition: bag.h:78
std::string const & getTopic() const
MessageInstance(ConnectionInfo const *connection_info, IndexEntry const &index, Bag const &bag)
std::string const & getDataType() const
std::string getCallerId() const


rosbag_storage
Author(s):
autogenerated on Sun Feb 3 2019 03:29:47