22 #include "mongo/base/disallow_copying.h"
23 #include "mongo/base/initializer_function.h"
24 #include "mongo/base/status.h"
25 #include "mongo/platform/unordered_map.h"
26 #include "mongo/platform/unordered_set.h"
67 const std::vector<std::string>& prerequisites,
68 const std::vector<std::string>& dependents);
94 unordered_set<std::string> prerequisites;
97 typedef unordered_map<std::string, NodeData> NodeMap;
98 typedef NodeMap::value_type Node;
103 static Status recursiveTopSort(
const NodeMap& nodeMap,
104 const Node& currentNode,
105 std::vector<std::string>* inProgressNodeNames,
106 unordered_set<std::string>* visitedNodeNames,
107 std::vector<std::string>* sortedNames);
Status represents an error state or the absence thereof.
Definition: status.h:50
Representation of a dependency graph of "initialization operations.".
Definition: initializer_dependency_graph.h:47
Utility functions for parsing numbers from strings.
Definition: compare_numbers.h:20
Status topSort(std::vector< std::string > *sortedNames) const
Construct a topological sort of the dependency graph, and store that order into "sortedNames".
Status addInitializer(const std::string &name, const InitializerFunction &fn, const std::vector< std::string > &prerequisites, const std::vector< std::string > &dependents)
Add a new initializer node, named "name", to the dependency graph, with the given behavior...
stdx::function< Status(InitializerContext *)> InitializerFunction
An InitializerFunction implements the behavior of an initializer operation.
Definition: initializer_function.h:23
InitializerFunction getInitializerFunction(const std::string &name) const
Given a dependency operation node named "name", return its behavior function.