48 if (message_instance_ != NULL)
49 delete message_instance_;
53 if (view != NULL && !
end)
64 if (message_instance_ != NULL) {
65 delete message_instance_;
66 message_instance_ = NULL;
73 assert(view_ != NULL);
85 assert(view_ != NULL);
95 while (iter != iters_.back().iter)
107 return other.
iters_.empty();
111 return iters_.back().iter == other.
iters_.back().iter;
115 assert(view_ != NULL);
118 if (message_instance_ != NULL)
120 delete message_instance_;
121 message_instance_ = NULL;
130 populateSeek(iters_.back().iter);
132 if (view_->reduce_overlap_)
134 std::multiset<IndexEntry>::const_iterator last_iter = iters_.back().iter;
136 while (!iters_.empty() && iters_.back().iter == last_iter)
138 iters_.back().iter++;
139 if (iters_.back().iter == iters_.back().range->end)
147 iters_.back().iter++;
148 if (iters_.back().iter == iters_.back().range->end)
158 if (message_instance_ == NULL)
161 return *message_instance_;
168 View::View(
Bag const& bag,
ros::Time const& start_time,
ros::Time const& end_time,
bool const& reduce_overlap) : view_revision_(0), size_cache_(0), size_revision_(0), reduce_overlap_(reduce_overlap) {
169 addQuery(bag, start_time, end_time);
172 View::View(
Bag const& bag, boost::function<
bool(
ConnectionInfo const*)> query,
ros::Time const& start_time,
ros::Time const& end_time,
bool const& reduce_overlap) : view_revision_(0), size_cache_(0), size_revision_(0), reduce_overlap_(reduce_overlap) {
173 addQuery(bag, query, start_time, end_time);
192 if (range->begin->time <
begin)
193 begin = range->begin->time;
207 std::multiset<IndexEntry>::const_iterator e = range->end;
236 size_cache_ += std::distance(range->begin, range->end);
278 multiset<IndexEntry>
const& index = j->second;
283 std::multiset<IndexEntry>::const_iterator
begin = index.lower_bound(start_time_lookup_entry);
284 std::multiset<IndexEntry>::const_iterator
end = index.upper_bound(end_time_lookup_entry);
301 for (vector<MessageRange*>::iterator k =
ranges_.begin(); k !=
ranges_.end(); k++) {
322 if (query->bag->bag_revision_ != query->bag_revision) {
324 query->bag_revision = query->bag->bag_revision_;
331 std::vector<const ConnectionInfo*> connections;
332 connections.reserve(
ranges_.size());
336 connections.push_back(range->connection_info);