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
121 bool operator==(
const Holder& rhs)
const;
122 bool operator!=(
const Holder& rhs)
const;
162 const std::map<std::string, std::string>&
get_userdata()
const;
167 void set_userdata(
const std::map<std::string, std::string>& userdata);
169 friend std::ostream& operator<<(std::ostream& out,
const Holder& holder);
185 Impl& get_impl() {
return *impl; }
186 const Impl& get_impl()
const {
return *impl; }
188 virtual Holder* clone()
const = 0;
190 void save(xmlNode* node)
const ST_DEPRECATED;
206 void load(
Devicegraph* devicegraph,
const xmlNode* node) ST_DEPRECATED;
211 const Device* target) ST_DEPRECATED;
213 const std::unique_ptr<Impl> impl;
void set_userdata(const std::map< std::string, std::string > &userdata)
Set the userdata of the holder.
const std::map< std::string, std::string > & get_userdata() const
Return the userdata 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.
bool exists_in_probed() const
Checks if the holder exists in the probed devicegraph.
Devicegraph * get_devicegraph()
Return the devicegraph the holder belongs to.
bool exists_in_system() const
Checks if the holder exists in the system devicegraph.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
Device * get_target()
Get the target device of the holder.
An abstract base class for storage devices.
Definition: Device.h:81
An abstract base class for storage holders.
Definition: Holder.h:56
sid_t get_source_sid() const
Return the storage id (sid) of the source of the holder.
void create(Devicegraph *devicegraph, const Device *source, const Device *target) ST_DEPRECATED
Create a holder between source and target in the devicegraph.
void set_target(const Device *target)
Set the target device of the holder.
Device * get_source()
Get the source device of the holder.
Base class for storage exceptions.
Definition: Exception.h:113
bool exists_in_devicegraph(const Devicegraph *devicegraph) const
Checks if the holder exists in the devicegraph.
bool exists_in_staging() const
Checks if the holder exists in the staging devicegraph.
The storage namespace.
Definition: Actiongraph.h:39
unsigned int sid_t
An integer storage ID.
Definition: Device.h:67
void set_source(const Device *source)
Set the source device of the holder.