view.h
Go to the documentation of this file.
1 /*********************************************************************
2 * Software License Agreement (BSD License)
3 *
4 * Copyright (c) 2008, Willow Garage, Inc.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
17 * * Neither the name of Willow Garage, Inc. nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *********************************************************************/
34 
35 #ifndef ROSBAG_VIEW_H
36 #define ROSBAG_VIEW_H
37 
38 #include <memory.h>
40 
42 #include "rosbag/query.h"
43 #include "rosbag/macros.h"
44 #include "rosbag/structures.h"
45 
46 namespace rosbag {
47 
49 {
50  friend class Bag;
51 
52 public:
54 
60  class iterator : public boost::iterator_facade<iterator,
61  MessageInstance,
62  boost::forward_traversal_tag>
63  {
64  public:
65  iterator(iterator const& i);
66  iterator &operator=(iterator const& i);
67  iterator();
68  ~iterator();
69 
70  protected:
71  iterator(View* view, bool end = false);
72 
73  private:
74  friend class View;
75  friend class boost::iterator_core_access;
76 
77  void populate();
78  void populateSeek(std::multiset<IndexEntry>::const_iterator iter);
79 
80  bool equal(iterator const& other) const;
81 
82  void increment();
83 
84  MessageInstance& dereference() const;
85 
86  private:
88  std::vector<ViewIterHelper> iters_;
91  };
92 
94 
95  struct TrueQuery {
96  bool operator()(ConnectionInfo const*) const { return true; };
97  };
98 
100 
103  View(bool const& reduce_overlap = false);
104 
106 
112  View(Bag const& bag, rs2rosinternal::Time const& start_time = rs2rosinternal::TIME_MIN, rs2rosinternal::Time const& end_time = rs2rosinternal::TIME_MAX, bool const& reduce_overlap = false);
113 
115 
122  View(Bag const& bag, boost::function<bool(ConnectionInfo const*)> query,
123  rs2rosinternal::Time const& start_time = rs2rosinternal::TIME_MIN, rs2rosinternal::Time const& end_time = rs2rosinternal::TIME_MAX, bool const& reduce_overlap = false);
124 
125  ~View();
126 
127  iterator begin();
128  iterator end();
129  uint32_t size();
130 
132 
137  void addQuery(Bag const& bag, rs2rosinternal::Time const& start_time = rs2rosinternal::TIME_MIN, rs2rosinternal::Time const& end_time = rs2rosinternal::TIME_MAX);
138 
140 
146  void addQuery(Bag const& bag, boost::function<bool(ConnectionInfo const*)> query,
148 
149  std::vector<const ConnectionInfo*> getConnections();
150 
151  rs2rosinternal::Time getBeginTime();
152  rs2rosinternal::Time getEndTime();
153 
154 protected:
155  friend class iterator;
156 
157  void updateQueries(BagQuery* q);
158  void update();
159 
160  MessageInstance* newMessageInstance(ConnectionInfo const* connection_info, IndexEntry const& index, Bag const& bag);
161 
162 private:
163  View(View const& view);
164  View& operator=(View const& view);
165 
166 protected:
167  std::vector<MessageRange*> ranges_;
168  std::vector<BagQuery*> queries_;
170 
173 
175 };
176 
177 } // namespace rosbag
178 
179 #endif
GLuint GLuint end
ROSTIME_DECL const Time TIME_MAX
uint32_t size_revision_
Definition: view.h:172
uint32_t view_revision_
Definition: view.h:169
bool operator()(ConnectionInfo const *) const
Definition: view.h:96
uint32_t view_revision_
Definition: view.h:89
An iterator that points to a MessageInstance from a bag.
Definition: view.h:60
GLuint index
uint32_t size_cache_
Definition: view.h:171
not_this_one begin(...)
void update(rs2::update_device fwu_dev, std::vector< uint8_t > fw_image)
GLsizeiptr size
MessageInstance * message_instance_
Definition: view.h:90
unsigned int uint32_t
Definition: stdint.h:80
A class pointing into a bag file.
Time representation. May either represent wall clock time or ROS clock time.
Definition: time.h:177
std::vector< ViewIterHelper > iters_
Definition: view.h:88
Pairs of queries and the bags they come from (used internally by View)
Definition: query.h:100
iterator const_iterator
Definition: view.h:93
std::vector< MessageRange * > ranges_
Definition: view.h:167
GLdouble GLdouble GLdouble q
ROSTIME_DECL const Time TIME_MIN
GLenum query
Definition: bag.h:66
bool reduce_overlap_
Definition: view.h:174
std::vector< BagQuery * > queries_
Definition: view.h:168
int i
#define ROSBAG_DECL
#include <ros/macros.h> // for the DECL&#39;s


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