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

A class to calculate partition alignment based on hardware topology. More...

#include <Topology.h>

Public Member Functions

 Topology (long alignment_offset, unsigned long optimal_io_size)
 
 Topology (const Topology &topology)
 
Topologyoperator= (const Topology &topology)
 
long get_alignment_offset () const
 
void set_alignment_offset (long alignment_offset)
 
unsigned long get_optimal_io_size () const
 
void set_optimal_io_size (unsigned long optimal_io_size)
 
unsigned long get_minimal_grain () const
 
void set_minimal_grain (unsigned long minimal_grain)
 
unsigned long calculate_grain () const
 Calculates the grain.
 
bool can_be_aligned (const Region &region, AlignPolicy align_policy) const
 Checks whether a region can be aligned. More...
 
Region align (const Region &region, AlignPolicy align_policy=AlignPolicy::ALIGN_END) const
 Aligns a region. More...
 
bool operator== (const Topology &rhs) const
 
bool operator!= (const Topology &rhs) const
 
Impl & get_impl ()
 
const Impl & get_impl () const
 

Friends

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

Detailed Description

A class to calculate partition alignment based on hardware topology.

The starting sector of a partition must obey the form "sector = offset + X * grain". Alignment may fail is the start of the aligned partition region is after the end of the aligned partition region.

Member Function Documentation

Region storage::Topology::align ( const Region region,
AlignPolicy  align_policy = AlignPolicy::ALIGN_END 
) const

Aligns a region.

Exceptions
AlignError
bool storage::Topology::can_be_aligned ( const Region region,
AlignPolicy  align_policy 
) const

Checks whether a region can be aligned.

Alignment may fail if the aligned end is before the aligned start.


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