24#ifndef STORAGE_DEVICEGRAPH_H
25#define STORAGE_DEVICEGRAPH_H
28#include <boost/noncopyable.hpp>
30#include "storage/Devices/Device.h"
31#include "storage/Graphviz.h"
32#include "storage/Utils/Swig.h"
33#include "storage/UsedFeatures.h"
198 void load(
const std::string& filename);
205 void load(
const std::string& filename,
bool keep_sids);
212 void save(
const std::string& filename)
const;
392 uint64_t used_features() const ST_DEPRECATED;
428 friend std::ostream& operator<<(std::ostream& out, const
Devicegraph& devicegraph);
434 Impl& get_impl() {
return *impl; }
435 const Impl& get_impl()
const {
return *impl; }
439 const std::unique_ptr<Impl> impl;
Definition: Storage.h:392
Definition: Devicegraph.h:66
Definition: Devicegraph.h:58
Definition: Devicegraph.h:74
Definition: Devicegraph.h:50
An abstract base class for storage devices.
Definition: Device.h:82
Style callbacks used by Devicegraph::write_graphviz().
Definition: Graphviz.h:105
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
void remove_device(sid_t sid)
Removes the device with sid from the devicegraph.
void remove_device(Device *a)
Removes the device from the devicegraph.
const Storage * get_storage() const
Get the storage object the devicegraph belongs to.
std::vector< BlkFilesystem * > get_all_blk_filesystems()
Get all BlkFilesystems.
bool device_exists(sid_t sid) const
Check whether the device with sid exists.
std::vector< const Disk * > get_all_disks() const
Get all Disks.
const Device * find_device(sid_t sid) const
bool empty() const
Query whether the devicegraph is empty.
Device * find_device(sid_t sid)
std::vector< Disk * > get_all_disks()
Get all Disks.
void clear()
Clear the devicegraph.
std::vector< Md * > get_all_mds()
Get all Mds.
void load(const std::string &filename)
Load the devicegraph from a file.
std::vector< const Md * > get_all_mds() const
Get all Mds.
void save(const std::string &filename) const
Save the devicegraph to a file.
std::vector< LvmVg * > get_all_lvm_vgs()
Get all LvmVgs.
std::vector< const Filesystem * > get_all_filesystems() const
Get all Filesystems.
std::vector< const BlkFilesystem * > get_all_blk_filesystems() const
Get all BlkFilesystems.
void load(const std::string &filename, bool keep_sids)
Load the devicegraph from a file.
Storage * get_storage()
Get the storage object the devicegraph belongs to.
void remove_devices(std::vector< Device * > devices)
Removes the devices from the devicegraph.
std::vector< const LvmVg * > get_all_lvm_vgs() const
Get all LvmVgs.
void write_graphviz(const std::string &filename, DevicegraphStyleCallbacks *style_callbacks, View view) const
Writes the devicegraph in graphviz format.
bool holder_exists(sid_t source_sid, sid_t target_sid) const
Check whether a holder with source_sid and target_sid exists.
size_t num_devices() const
Return the number of devices.
size_t num_holders() const
Return the number of holders.
std::vector< Filesystem * > get_all_filesystems()
Get all Filesystems.
std::vector< Holder * > find_holders(sid_t source_sid, sid_t target_sid)
Find all holders with source_sid and sid_t target_sid.
Holder * find_holder(sid_t source_sid, sid_t target_sid)
Find the holder with source_sid and target_sid.
const Holder * find_holder(sid_t source_sid, sid_t target_sid) const
Find the holder with source_sid and target_sid.
void check(const CheckCallbacks *check_callbacks=nullptr) const
Checks the devicegraph.
void remove_holder(Holder *holder)
Removes the holder from the devicegraph.
std::vector< const Holder * > find_holders(sid_t source_sid, sid_t target_sid) const
Find all holders with source_sid and sid_t target_sid.
Base class for storage exceptions.
Definition: Exception.h:114
const std::string & msg() const
Return the message string provided to the constructor.
Definition: Exception.h:150
Definition: Devicegraph.h:98
Definition: Devicegraph.h:90
Definition: Devicegraph.h:82
An abstract base class for storage holders.
Definition: Holder.h:57
The main entry point to libstorage.
Definition: Storage.h:413
Definition: Devicegraph.h:114
Definition: Devicegraph.h:122
Definition: Devicegraph.h:106
The storage namespace.
Definition: Actiongraph.h:39
uint64_t uf_t
Type for used features.
Definition: UsedFeatures.h:63
View
Enum with possible views on the devicegraph.
Definition: View.h:34
unsigned int sid_t
An integer storage ID.
Definition: Device.h:67
UsedFeaturesDependencyType
Enum specifying the dependency type of used features.
Definition: UsedFeatures.h:38
GraphvizFlags
Bitfield to control graphviz output.
Definition: Graphviz.h:45