libstorage-ng
User.h
1 /*
2  * Copyright (c) [2014-2015] Novell, Inc.
3  * Copyright (c) [2016-2020] SUSE LLC
4  *
5  * All Rights Reserved.
6  *
7  * This program is free software; you can redistribute it and/or modify it
8  * under the terms of version 2 of the GNU General Public License as published
9  * by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, contact Novell, Inc.
18  *
19  * To contact Novell about this file by physical or electronic mail, you may
20  * find current contact information at www.novell.com.
21  */
22 
23 
24 #ifndef STORAGE_USER_H
25 #define STORAGE_USER_H
26 
27 
28 #include "storage/Holders/Holder.h"
29 
30 
31 namespace storage
32 {
33 
40  class User : public Holder
41  {
42  public:
43 
53  static User* create(Devicegraph* devicegraph, const Device* source, const Device* target);
54 
55  static User* load(Devicegraph* devicegraph, const xmlNode* node);
56 
57  virtual User* clone() const override;
58 
59  public:
60 
61  class Impl;
62 
63  Impl& get_impl();
64  const Impl& get_impl() const;
65 
66  User(Impl* impl);
67 
68  };
69 
70 
76  bool is_user(const Holder* holder);
77 
84  User* to_user(Holder* holder);
85 
89  const User* to_user(const Holder* holder);
90 
91 }
92 
93 #endif
User * to_user(Holder *holder)
Converts pointer to Holder to pointer to User.
bool is_user(const Holder *holder)
Checks whether holder points to an User.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
An abstract base class for storage devices.
Definition: Device.h:81
static User * create(Devicegraph *devicegraph, const Device *source, const Device *target)
Create a holder of type User.
An abstract base class for storage holders.
Definition: Holder.h:56
Generic holder from one device to another device, e.g.
Definition: User.h:40
The storage namespace.
Definition: Actiongraph.h:39