libstorage-ng
 All Classes Namespaces Functions Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Friends | List of all members
storage::Region Class Reference

A start/length pair with a block size. More...

#include <Region.h>

Public Member Functions

 Region (unsigned long long start, unsigned long long length, unsigned int block_size)
 
 Region (const Region &region)
 
Regionoperator= (const Region &region)
 
bool empty () const
 
unsigned long long get_start () const
 
unsigned long long get_length () const
 
unsigned long long get_end () const
 
void set_start (unsigned long long start)
 
void set_length (unsigned long long length)
 
void adjust_start (long long delta)
 
void adjust_length (long long delta)
 
unsigned int get_block_size () const
 
void set_block_size (unsigned int block_size)
 
unsigned long long to_bytes (unsigned long long blocks) const
 
unsigned long long to_blocks (unsigned long long bytes) const
 
bool operator== (const Region &rhs) const
 
bool operator!= (const Region &rhs) const
 
bool operator< (const Region &rhs) const
 
bool operator> (const Region &rhs) const
 
bool inside (const Region &rhs) const
 
bool intersect (const Region &rhs) const
 
Region intersection (const Region &rhs) const
 
std::vector< Regionunused_regions (const std::vector< Region > &used_regions) const
 Returns all regions not included in used_regions. More...
 
Impl & get_impl ()
 
const Impl & get_impl () const
 

Friends

std::ostream & operator<< (std::ostream &s, const Region &region)
 
bool getChildValue (const xmlNode *node, const char *name, Region &value)
 
void setChildValue (xmlNode *node, const char *name, const Region &value)
 

Detailed Description

A start/length pair with a block size.

Comparing Regions with different block_sizes will throw an exception.

Member Function Documentation

std::vector<Region> storage::Region::unused_regions ( const std::vector< Region > &  used_regions) const

Returns all regions not included in used_regions.

Regions in used_regions must not overlap and be inside the region. All block sizes must be identical.


The documentation for this class was generated from the following file: