src
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
28
#include "
rosbag/message_instance.h
"
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
; }
47
string
const
&
MessageInstance::getMessageDefinition
()
const
{
return
connection_info_
->
msg_def
; }
48
49
shared_ptr<ros::M_string>
MessageInstance::getConnectionHeader
()
const
{
return
connection_info_
->
header
; }
50
51
string
MessageInstance::getCallerId
()
const
{
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
56
bool
MessageInstance::isLatching
()
const
{
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
{
62
return
bag_
->
readMessageDataSize
(
index_entry_
);
63
}
64
65
}
// namespace rosbag
rosbag::MessageInstance::MessageInstance
MessageInstance(ConnectionInfo const *connection_info, IndexEntry const &index, Bag const &bag)
Definition:
message_instance.cpp:38
rosbag::MessageInstance::connection_info_
ConnectionInfo const * connection_info_
Definition:
message_instance.h:131
rosbag::Bag
Definition:
bag.h:131
rosbag::Bag::readMessageDataSize
uint32_t readMessageDataSize(IndexEntry const &index_entry) const
Definition:
bag.cpp:892
boost::shared_ptr
rosbag::ConnectionInfo::header
boost::shared_ptr< ros::M_string > header
Definition:
structures.h:121
rosbag::ConnectionInfo::topic
std::string topic
Definition:
structures.h:116
rosbag::ConnectionInfo::md5sum
std::string md5sum
Definition:
structures.h:118
rosbag::ConnectionInfo
Definition:
structures.h:79
rosbag::MessageInstance::isLatching
bool isLatching() const
Definition:
message_instance.cpp:56
message_instance.h
rosbag::MessageInstance::getMD5Sum
std::string const & getMD5Sum() const
Definition:
message_instance.cpp:46
rosbag::ConnectionInfo::datatype
std::string datatype
Definition:
structures.h:117
rosbag::IndexEntry
Definition:
structures.h:108
rosbag::MessageInstance::size
uint32_t size() const
Size of serialized message.
Definition:
message_instance.cpp:61
rosbag::MessageInstance::bag_
Bag const * bag_
Definition:
message_instance.h:133
rosbag::ConnectionInfo::msg_def
std::string msg_def
Definition:
structures.h:119
rosbag::MessageInstance::index_entry_
const IndexEntry index_entry_
Definition:
message_instance.h:132
rosbag::MessageInstance::getConnectionHeader
boost::shared_ptr< ros::M_string > getConnectionHeader() const
Definition:
message_instance.cpp:49
ros::Time
rosbag::MessageInstance::getMessageDefinition
std::string const & getMessageDefinition() const
Definition:
message_instance.cpp:47
rosbag::MessageInstance::getCallerId
std::string getCallerId() const
Definition:
message_instance.cpp:51
rosbag::MessageInstance::getTime
ros::Time const & getTime() const
Definition:
message_instance.cpp:43
rosbag
Definition:
aes_encryptor.h:43
rosbag::IndexEntry::time
ros::Time time
timestamp of the message
Definition:
structures.h:110
rosbag::MessageInstance::getTopic
std::string const & getTopic() const
Definition:
message_instance.cpp:44
message_event.h
rosbag::MessageInstance::getDataType
std::string const & getDataType() const
Definition:
message_instance.cpp:45
rosbag_storage
Author(s): Dirk Thomas
, Jacob Perron
autogenerated on Sat Sep 14 2024 02:59:52