- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# dependency_graph Class Reference

`#include <depgraph.hpp>`

List of all members.

## Public Types
typedef std::map < artifact, std::set < artifact > > | graph_type
| The graph type.
## Public Member Functions
void | store_dependency (artifact const &target, artifact const &dependency)
graph_type const & | graph () const
| Return the graph.
template<class OutIter>
void | sort (OutIter sorted) const

## Detailed Description

Listing 56-5. Storing Pointers in the Dependency Graph Represent a dependency as a map of sets. The map key is the dependency. The value is a set of targets that have the key as a dependency.

Definition at line 14 of file depgraph.hpp.

## Member Function Documentation

void dependency_graph::store_dependency | ( | artifact const & | target,
|  | artifact const & | dependency |
| ) |  |  |

Record a dependency in the graph.

Parameters:

  | target | The target of the dependency relationship
  | dependency | The target depends on this `dependency`

Listing 56-5. Storing Pointers in the Dependency Graph

Definition at line 6 of file depgraph.cpp.

Referenced by parse_graph().

template<class OutIter>

void dependency_graph::sort | ( | OutIter | sorted | ) | const`[inline]`

Sort the dependency graph using topological sort. Generate a list of dependencies starting with targets that have no dependencies.

Parameters:

  `[out]` | sorted | Store the sorted dependencies here

Definition at line 33 of file depgraph.hpp.

References topological_sort().

Referenced by main().

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

- depgraph.hpp
- depgraph.cpp