~ubuntu-branches/ubuntu/precise/mdds/precise

« back to all changes in this revision

Viewing changes to include/mdds/segment_tree.hpp

  • Committer: Package Import Robot
  • Author(s): Rene Engelhard
  • Date: 2011-10-30 21:50:26 UTC
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: package-import@ubuntu.com-20111030215026-sg7nxg386h4qjuzd
Tags: upstream-0.5.4
ImportĀ upstreamĀ versionĀ 0.5.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
156
156
    };
157
157
#endif
158
158
 
159
 
#ifdef UNIT_TEST
160
159
public:
161
 
#else
162
 
private:
163
 
#endif
164
160
    typedef ::std::vector<data_type*> data_chain_type;
165
161
    typedef _mdds_unordered_map_type<data_type*, ::std::pair<key_type, key_type> > segment_map_type;
166
162
    typedef ::std::map<data_type*, ::std::pair<key_type, key_type> >               sorted_segment_map_type;
234
230
    {
235
231
        ::std::string operator() (const node& _self) const
236
232
        {
 
233
#ifdef UNIT_TEST
237
234
            ::std::ostringstream os;
238
235
            if (_self.is_leaf)
239
236
            {
260
257
            }
261
258
            os << " ";
262
259
            return os.str();
 
260
#else
 
261
            return ::std::string();
 
262
#endif
263
263
        }
264
264
    };
265
265
 
436
436
 
437
437
        bool operator== (const iterator_base& r) const
438
438
        {
439
 
            return mp_res_chains.get() == r.mp_res_chains.get() && 
440
 
                m_cur_chain == r.m_cur_chain && m_cur_pos_in_chain == r.m_cur_pos_in_chain &&
441
 
                m_end_pos == r.m_end_pos;
 
439
            if (mp_res_chains.get())
 
440
            {
 
441
                // non-empty result set.
 
442
                return mp_res_chains.get() == r.mp_res_chains.get() &&
 
443
                    m_cur_chain == r.m_cur_chain && m_cur_pos_in_chain == r.m_cur_pos_in_chain &&
 
444
                    m_end_pos == r.m_end_pos;
 
445
            }
 
446
 
 
447
            // empty result set.
 
448
            if (r.mp_res_chains.get())
 
449
                return false;
 
450
            return m_end_pos == r.m_end_pos;
442
451
        }
443
452
 
444
453
        bool operator!= (const iterator_base& r) const { return !operator==(r); }