24 #ifndef STORAGE_HOLDER_H
25 #define STORAGE_HOLDER_H
28 #include <libxml/tree.h>
30 #include <boost/noncopyable.hpp>
32 #include "storage/Devices/Device.h"
33 #include "storage/Utils/Swig.h"
56 class Holder :
private boost::noncopyable
96 bool operator==(
const Holder& rhs)
const;
97 bool operator!=(
const Holder& rhs)
const;
144 friend std::ostream& operator<<(std::ostream& out,
const Holder& holder);
150 Impl& get_impl() {
return *impl; }
151 const Impl& get_impl()
const {
return *impl; }
153 virtual Holder* clone()
const = 0;
155 void save(xmlNode* node)
const ST_DEPRECATED;
171 void load(
Devicegraph* devicegraph,
const xmlNode* node);
178 const std::unique_ptr<Impl> impl;
void set_userdata(const std::map< std::string, std::string > &userdata)
Set the userdata of the holder.
bool exists_in_devicegraph(const Devicegraph *devicegraph) const
Checks if the holder exists in the devicegraph.
const std::map< std::string, std::string > & get_userdata() const
Return the userdata of the holder.
bool exists_in_system() const
Checks if the holder exists in the system devicegraph.
The storage namespace.
Definition: Actiongraph.h:39
sid_t get_source_sid() const
Return the storage id (sid) of the source of the holder.
const Device * get_source() const
Get the source device of the holder.
bool exists_in_staging() const
Checks if the holder exists in the staging devicegraph.
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
const Device * get_target() const
Get the target device of the holder.
sid_t get_target_sid() const
Return the storage id (sid) of the target of the holder.
Holder * copy_to_devicegraph(Devicegraph *devicegraph) const
Copies the holder to the devicegraph.
Device * get_target()
Get the target device of the holder.
bool exists_in_probed() const
Checks if the holder exists in the probed devicegraph.
An abstract base class for storage devices.
Definition: Device.h:82
void create(Devicegraph *devicegraph, const Device *source, const Device *target)
Create a holder between source and target in the devicegraph.
Device * get_source()
Get the source device of the holder.
Base class for storage exceptions.
Definition: Exception.h:114
An abstract base class for storage holders.
Definition: Holder.h:57
unsigned int sid_t
An integer storage ID.
Definition: Device.h:67