24 #ifndef STORAGE_REGION_H
25 #define STORAGE_REGION_H
28 #include <libxml/tree.h>
32 #include "storage/Utils/Exception.h"
76 Region(
unsigned long long start,
unsigned long long length,
unsigned int block_size);
84 unsigned long long get_start()
const;
85 unsigned long long get_length()
const;
86 unsigned long long get_end()
const;
88 void set_start(
unsigned long long start);
89 void set_length(
unsigned long long length);
91 void adjust_start(
long long delta);
92 void adjust_length(
long long delta);
94 unsigned int get_block_size()
const;
95 void set_block_size(
unsigned int block_size);
97 unsigned long long to_bytes(
unsigned long long blocks)
const;
98 unsigned long long to_blocks(
unsigned long long bytes)
const;
100 bool operator==(
const Region& rhs)
const;
101 bool operator!=(
const Region& rhs)
const;
102 bool operator<(
const Region& rhs)
const;
103 bool operator>(
const Region& rhs)
const;
105 bool inside(
const Region& rhs)
const;
107 bool intersect(
const Region& rhs)
const;
115 std::vector<Region>
unused_regions(
const std::vector<Region>& used_regions)
const;
117 friend std::ostream& operator<<(std::ostream& s,
const Region& region);
124 const Impl& get_impl()
const;
126 friend bool getChildValue(
const xmlNode* node,
const char* name,
Region& value);
127 friend void setChildValue(xmlNode* node,
const char* name,
const Region& value);
131 const std::unique_ptr<Impl> impl;
A start/length pair with a block size.
Definition: Region.h:71
std::vector< Region > unused_regions(const std::vector< Region > &used_regions) const
Returns all regions not included in used_regions.
Base class for storage exceptions.
Definition: Exception.h:113
The storage namespace.
Definition: Actiongraph.h:36