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;
34 using std::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 
49 shared_ptr<rs2rosinternal::M_string> MessageInstance::getConnectionHeader() const { return connection_info_->header; }
50 
52  rs2rosinternal::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  rs2rosinternal::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 
63 }
64 
65 } // namespace rosbag
uint32_t readMessageDataSize(IndexEntry const &index_entry) const
Definition: bag.cpp:906
ConnectionInfo const * connection_info_
IndexEntry const index_entry_
GLsizei const GLchar *const * string
std::string const & getMD5Sum() const
std::string md5sum
Definition: structures.h:55
rs2rosinternal::Time const & getTime() const
std::shared_ptr< rs2rosinternal::M_string > header
Definition: structures.h:58
unsigned int uint32_t
Definition: stdint.h:80
uint32_t size() const
Size of serialized message.
Time representation. May either represent wall clock time or ROS clock time.
Definition: time.h:177
std::string msg_def
Definition: structures.h:56
std::string const & getMessageDefinition() const
std::string datatype
Definition: structures.h:54
std::shared_ptr< rs2rosinternal::M_string > getConnectionHeader() const
Definition: bag.h:66
std::string const & getTopic() const
MessageInstance(ConnectionInfo const *connection_info, IndexEntry const &index, Bag const &bag)
std::string const & getDataType() const
rs2rosinternal::Time time
Definition: structures.h:79
std::string getCallerId() const
::std_msgs::Time_< std::allocator< void > > Time
Definition: Time.h:47


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:21