19 #ifndef _HIRISE_GAP_MAP_
20 #define _HIRISE_GAP_MAP_
24 #if defined (INCLUDE_PVL)
79 typedef std::pair<Location, Location>
Range;
82 typedef std::vector<Range>
List;
88 static const char*
const
92 static const char*
const
103 static const char*
const
118 static const unsigned int
142 Gap_Map (std::istream& stream,
unsigned int count);
168 virtual std::string
id ()
const;
175 virtual const char*
name ()
const;
248 {
return in_gap (range.first, range.second);}
288 {
return set (range.first, range.second);}
334 {
return clear (range.first, range.second);}
450 virtual std::ostream&
print
451 (std::ostream& stream = std::cout,
bool verbose =
false)
const;
453 #if defined (INCLUDE_PVL)
507 (
void* start,
void* end,
unsigned int threshold = 0);
571 std::ostream&
operator<<
572 (std::ostream& stream,
const Gap_Map& map);
Index count_of(Index element) const
A Data_Component provides a common, virtual interface for all HiRISE Observation data blocks.
Definition: Data_Component.hh:124
A Gap_Map contains a map of data gap ranges for the file with which it is associated.
Definition: Gap_Map.hh:70
virtual Data_Component & put(const Location location, Index range, End_Point end_point)
Puts a the value of an end-point into a gap range.
Definition: Gap_Map.cc:813
@ OUTSIDE
Definition: Gap_Map.hh:110
@ INSIDE
Definition: Gap_Map.hh:109
@ OVERLAP
Definition: Gap_Map.hh:111
virtual std::ostream & print(std::ostream &stream=std::cout, bool verbose=false) const
Prints the component structure and contents.
Definition: Gap_Map.cc:1139
u_int_32 Location
A gap range end-point offset location value.
Definition: Gap_Map.hh:76
Gap_Map & operator=(const Gap_Map &map)
Assigns another Gap_Map to this one.
Definition: Gap_Map.cc:220
static const u_int_8 GAP_BYTE_VALUE
The value of a "gap filled" data byte.
Definition: Gap_Map.hh:123
End_Point
Gap range end-point value symbols.
Definition: Gap_Map.hh:97
@ RANGE_START
Definition: Gap_Map.hh:98
@ RANGE_END
Definition: Gap_Map.hh:99
Gap_Map & insert_range(Index range, Location start, Location end)
Inserts a new range into the map.
Definition: Gap_Map.cc:848
bool in_gap(const Location location) const
Tests if a location falls in a gap range.
Definition: Gap_Map.cc:313
virtual std::string id() const
Provides the class ID on a line followed by the base Data_Component::id.
Definition: Gap_Map.cc:233
static const unsigned int DEFAULT_SEQUENCE_THRESHOLD
The default sequence of gap byte values required for a gap segment.
Definition: Gap_Map.hh:119
Gap_Map & set(const Location start, const Location end)
Sets a gap range.
Definition: Gap_Map.cc:411
int in_gap(const Gap_Map::Range &range) const
Tests if a Range overlaps a gap range in the map.
Definition: Gap_Map.hh:247
Gap_Map & shift(int_32 amount)
Shifts all range locations some amount.
Definition: Gap_Map.cc:718
virtual Location get(Index range, End_Point end_point) const
Gets a gap range end-point value.
Definition: Gap_Map.cc:244
std::pair< Location, Location > Range
A gap range end-point pair of offset location values.
Definition: Gap_Map.hh:79
virtual const char * name() const
Gets the NAME of this class.
Definition: Gap_Map.cc:238
virtual bool is_valid() const
Tests if the component data is valid.
Definition: Gap_Map.cc:1296
Gap_Map & remove_range(Index first, Index last=(Index) -1)
Removes ranges from the map.
Definition: Gap_Map.cc:966
static unsigned int sequence_threshold(unsigned int threshold=0)
Gets the sequence threshold for determining a gap segment range, optionally setting a new threshold.
Definition: Gap_Map.cc:1281
static const char *const END_POINT_NAMES[]
Gap range end-point value names.
Definition: Gap_Map.hh:104
Gap_Map::Range gap(Index range) const
Gets a gap Range.
Definition: Gap_Map.cc:276
Gap_Map::List gaps() const
Gets a List of Range pairs from the map.
Definition: Gap_Map.cc:296
Gap_Map & clear()
Clears the entire map.
Definition: Gap_Map.hh:324
Gap_Map & clear(const Gap_Map::Range &range)
Clears a gap range.
Definition: Gap_Map.hh:333
unsigned int total_gaps() const
Gets the total number of gap segments in the map.
Definition: Gap_Map.hh:210
Gap_Map & set(const Gap_Map::Range &range)
Sets a gap Range.
Definition: Gap_Map.hh:287
std::vector< Range > List
A list of gap range pairs.
Definition: Gap_Map.hh:82
static const char *const ID
Class identification name with source code version and date.
Definition: Gap_Map.hh:89
static const char *const NAME
The component name.
Definition: Gap_Map.hh:93
static Gap_Map::List gaps_in(void *start, void *end, unsigned int threshold=0)
Gets a list of gap ranges in a data block.
Definition: Gap_Map.cc:1190
idaeim::PVL::Aggregate * PVL_description() const
Produces a PVL description of a Gap_Map for a PDS label.
Definition: Gap_Map.cc:1070
virtual idaeim::PVL::Aggregate * PVL() const
Produces a PVL rendition of the component.
Definition: Gap_Map.cc:1038
Gap_Map()
Constructs an empty Gap_Map.
Definition: Gap_Map.cc:143
U_INT_8_TYPE u_int_8
8-bit unsigned integer type.
Definition: Data_Component.hh:56
INT_32_TYPE int_32
32-bit integer type.
Definition: Data_Component.hh:74
PIRL::Data_Block::Index Index
Data_Block element index type.
Definition: Data_Component.hh:95