query_results_impl.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, Willow Garage, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Willow Garage, Inc. nor the names of its
14  * contributors may be used to endorse or promote products derived from
15  * this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  */
30 
40 namespace warehouse_ros
41 {
42 template <class M>
44  : results_(results), metadata_only_(metadata_only)
45 {
46  if (!results_->hasData())
47  results_.reset();
48 }
49 
50 template <class M>
53 {
54 }
55 
56 template <class M>
58 {
59 }
60 
61 template <class M>
63 {
64 }
65 
66 template <class M>
68 {
69  results_ = other.results_;
71  return *this;
72 }
73 
74 template <class M>
76 {
77  if (!results_->next())
78  {
79  results_.reset();
80  }
81 }
82 
83 template <class M>
85 {
87 
88  typename MessageWithMetadata<M>::Ptr msg(new MessageWithMetadata<M>(results_->metadata()));
89  if (!metadata_only_)
90  {
91  std::string str = results_->message();
92  uint8_t* buf = (uint8_t*)str.c_str();
93  ros::serialization::IStream istream(buf, str.size());
95  }
96  return msg;
97 }
98 
99 template <class M>
101 {
102  // Incomplete, the only case we care about is whether iter is at the end
103  return (!results_ && !other.results_);
104 }
105 
106 } // namespace warehouse_ros
ResultIteratorHelper::Ptr results_
Definition: query_results.h:87
Class that wraps (via inheritance) a ROS message type, together with additional metadata (a yaml dict...
bool equal(const ResultIterator< M > &other) const
ResultIterator & operator=(const ResultIterator &other)
static void read(Stream &stream, typename boost::call_traits< T >::reference t)
ResultIterator()
Constructor for past_the_end iterator.
MessageWithMetadata< M >::ConstPtr dereference() const
#define ROS_ASSERT(cond)


warehouse_ros
Author(s): Bhaskara Marthi , Connor Brew
autogenerated on Mon Apr 26 2021 02:23:26