libstorage-ng
 
Loading...
Searching...
No Matches
storage::Actiongraph Class Reference

The actiongraph has all actions including the dependencies among them to get from one devicegraph to another. More...

#include <Actiongraph.h>

Inheritance diagram for storage::Actiongraph:
[legend]
Collaboration diagram for storage::Actiongraph:
[legend]

Public Member Functions

 Actiongraph (const Storage &storage, Devicegraph *lhs, Devicegraph *rhs)
 Calculate the actiongraph to get from the LHS (left-hand side) to the RHS (right-hand side) devicegraph.
 
const Storageget_storage () const
 Get the storage object for which the actiongraph was constructed.
 
const Devicegraphget_devicegraph (Side side) const
 Get the left or right devicegraph for which the actiongraph was constructed.
 
bool empty () const
 Check whether the actiongraph is empty.
 
size_t num_actions () const
 Return the number of actions in the actiongraph.
 
uf_t used_features () const
 Calculates a bit-field with the used features of the actiongraph.
 
void print_graph () const
 Print the actiongraph on cout.
 
void print_order () const
 Print the order of the actions on cout.
 
void write_graphviz (const std::string &filename, ActiongraphStyleCallbacks *style_callbacks) const
 Writes the actiongraph in graphviz format.
 
void write_graphviz (const std::string &filename, GraphvizFlags flags=GraphvizFlags::NAME, GraphvizFlags tooltip_flags=GraphvizFlags::NONE) const
 Writes the actiongraph in graphviz format.
 
std::vector< const Action::Base * > get_commit_actions () const
 Sorted according to dependencies among actions.
 
std::vector< std::string > get_commit_actions_as_strings () const ST_DEPRECATED
 
void generate_compound_actions ()
 Already called inside of Storage::calculate_actiongraph().
 
std::vector< const CompoundAction * > get_compound_actions () const
 
Impl & get_impl ()
 
const Impl & get_impl () const
 

Detailed Description

The actiongraph has all actions including the dependencies among them to get from one devicegraph to another.

Constructor & Destructor Documentation

◆ Actiongraph()

storage::Actiongraph::Actiongraph ( const Storage & storage,
Devicegraph * lhs,
Devicegraph * rhs )

Calculate the actiongraph to get from the LHS (left-hand side) to the RHS (right-hand side) devicegraph.

Throws an exception if unsupported actions are required (e.g. create a disk or rename an LVM volume group) or if the resulting graph has cycles.

Exceptions
Exception

Member Function Documentation

◆ get_commit_actions()

std::vector< const Action::Base * > storage::Actiongraph::get_commit_actions ( ) const

Sorted according to dependencies among actions.

So there can be some randomness in the sorting.

◆ print_graph()

void storage::Actiongraph::print_graph ( ) const

Print the actiongraph on cout.

Not for production code.

◆ print_order()

void storage::Actiongraph::print_order ( ) const

Print the order of the actions on cout.

Not for production code.

◆ write_graphviz() [1/2]

void storage::Actiongraph::write_graphviz ( const std::string & filename,
ActiongraphStyleCallbacks * style_callbacks ) const

Writes the actiongraph in graphviz format.

The style_callbacks are used to define graphviz attributes for the graph, nodes and edges, e.g. label, color and shape.

Exceptions
Exception

◆ write_graphviz() [2/2]

void storage::Actiongraph::write_graphviz ( const std::string & filename,
GraphvizFlags flags = GraphvizFlags::NAME,
GraphvizFlags tooltip_flags = GraphvizFlags::NONE ) const

Writes the actiongraph in graphviz format.

Deprecated in favor of write_graphviz(const std::string&, ActiongraphStyleCallbacks*).

Exceptions
Exception

The documentation for this class was generated from the following file: