libstorage-ng
CompoundAction.h
1 /*
2  * Copyright (c) [2017-2020] SUSE LLC
3  *
4  * All Rights Reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as published
8  * by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, contact SUSE LLC.
17  *
18  * To contact SUSE LLC about this file by physical or electronic mail, you may
19  * find current contact information at www.suse.com.
20  */
21 
22 
23 #ifndef STORAGE_COMPOUND_ACTION_H
24 #define STORAGE_COMPOUND_ACTION_H
25 
26 
27 #include <memory>
28 #include <string>
29 #include <boost/noncopyable.hpp>
30 
31 
32 namespace storage
33 {
34 
35  namespace Action
36  {
37  class Base;
38  }
39 
40  class Actiongraph;
41  class Device;
42 
49  class CompoundAction : private boost::noncopyable
50  {
51 
52  public:
53 
54  CompoundAction(const Actiongraph* actiongraph);
55  ~CompoundAction();
56 
57  const Device* get_target_device() const;
58 
59  std::string sentence() const;
60 
61  bool is_delete() const;
62 
68  static CompoundAction* find_by_target_device(Actiongraph* actiongraph, const Device* device);
69 
73  static const CompoundAction* find_by_target_device(const Actiongraph* actiongraph, const Device* device);
74 
75  public:
76 
77  class Generator;
78  class Formatter;
79 
80  class Impl;
81 
82  Impl& get_impl() { return *impl; }
83  const Impl& get_impl() const { return *impl; }
84 
85  private:
86 
87  const std::unique_ptr<Impl> impl;
88 
89  };
90 
91 }
92 
93 #endif
static CompoundAction * find_by_target_device(Actiongraph *actiongraph, const Device *device)
Deprecated.
A Compound Action groups several related actions from an actiongraph.
Definition: CompoundAction.h:49
The actiongraph has all actions including the dependencies among them to get from one devicegraph to ...
Definition: Actiongraph.h:60
An abstract base class for storage devices.
Definition: Device.h:81
The storage namespace.
Definition: Actiongraph.h:38