haiku/headers/private/debugger/util/RangeList.h
Rene Gollent fce4895d18 Debugger: Split into core library and application.
- Add subfolder src/kits/debugger which contains the debugger's core
  functionality and lower layers. Correspondingly add headers/private/debugger
  for shared headers to be used by clients such as the Debugger application
  and eventual remote_debug_server. Adjust various files to account for
  differences as a result of the split and moves.
- Add libdebugger.so to minimal Jamfile.
2016-06-04 13:18:39 -04:00

56 lines
893 B
C++

/*
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License.
*/
#ifndef RANGE_LIST_H
#define RANGE_LIST_H
#include <ObjectList.h>
#include <SupportDefs.h>
struct Range {
int32 lowerBound;
int32 upperBound;
Range()
:
lowerBound(-1),
upperBound(-1)
{
}
Range(int32 lowValue, int32 highValue)
:
lowerBound(lowValue),
upperBound(highValue)
{
}
};
class RangeList : private BObjectList<Range>
{
public:
RangeList();
virtual ~RangeList();
status_t AddRange(int32 lowValue, int32 highValue);
status_t AddRange(const Range& range);
void RemoveRangeAt(int32 index);
int32 CountRanges() const;
const Range* RangeAt(int32 index) const;
bool Contains(int32 value) const;
private:
void _CollapseOverlappingRanges(int32 startIndex,
int32 highValue);
};
#endif // RANGE_LIST_H