diff options
Diffstat (limited to 'src/mongo/base/initializer.h')
-rw-r--r-- | src/mongo/base/initializer.h | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/mongo/base/initializer.h b/src/mongo/base/initializer.h index a8abc6603b3..fa4ba508981 100644 --- a/src/mongo/base/initializer.h +++ b/src/mongo/base/initializer.h @@ -37,59 +37,59 @@ namespace mongo { - /** - * Class representing an initialization process. - * - * Such a process is described by a directed acyclic graph of initialization operations, the - * InitializerDependencyGraph. One constructs an initialization process by adding nodes and - * edges to the graph. Then, one executes the process, causing each initialization operation to - * execute in an order that respects the programmer-established prerequistes. - */ - class Initializer { - MONGO_DISALLOW_COPYING(Initializer); - public: - Initializer(); - ~Initializer(); - - /** - * Get the initializer dependency graph, presumably for the purpose of adding more nodes. - */ - InitializerDependencyGraph& getInitializerDependencyGraph() { return _graph; } - - /** - * Execute the initializer process, using the given argv and environment data as input. - * - * Returns Status::OK on success. All other returns constitute initialization failures, - * and the thing being initialized should be considered dead in the water. - */ - Status execute(const InitializerContext::ArgumentVector& args, - const InitializerContext::EnvironmentMap& env) const; +/** + * Class representing an initialization process. + * + * Such a process is described by a directed acyclic graph of initialization operations, the + * InitializerDependencyGraph. One constructs an initialization process by adding nodes and + * edges to the graph. Then, one executes the process, causing each initialization operation to + * execute in an order that respects the programmer-established prerequistes. + */ +class Initializer { + MONGO_DISALLOW_COPYING(Initializer); - private: +public: + Initializer(); + ~Initializer(); - InitializerDependencyGraph _graph; - }; + /** + * Get the initializer dependency graph, presumably for the purpose of adding more nodes. + */ + InitializerDependencyGraph& getInitializerDependencyGraph() { + return _graph; + } /** - * Run the global initializers. + * Execute the initializer process, using the given argv and environment data as input. * - * It's a programming error for this to fail, but if it does it will return a status other - * than Status::OK. - * - * This means that the few initializers that might want to terminate the program by failing - * should probably arrange to terminate the process themselves. + * Returns Status::OK on success. All other returns constitute initialization failures, + * and the thing being initialized should be considered dead in the water. */ - Status runGlobalInitializers(const InitializerContext::ArgumentVector& args, - const InitializerContext::EnvironmentMap& env); + Status execute(const InitializerContext::ArgumentVector& args, + const InitializerContext::EnvironmentMap& env) const; - Status runGlobalInitializers( - int argc, const char* const* argv, const char* const* envp); +private: + InitializerDependencyGraph _graph; +}; - /** - * Same as runGlobalInitializers(), except prints a brief message to std::cerr - * and terminates the process on failure. - */ - void runGlobalInitializersOrDie( - int argc, const char* const* argv, const char* const* envp); +/** + * Run the global initializers. + * + * It's a programming error for this to fail, but if it does it will return a status other + * than Status::OK. + * + * This means that the few initializers that might want to terminate the program by failing + * should probably arrange to terminate the process themselves. + */ +Status runGlobalInitializers(const InitializerContext::ArgumentVector& args, + const InitializerContext::EnvironmentMap& env); + +Status runGlobalInitializers(int argc, const char* const* argv, const char* const* envp); + +/** + * Same as runGlobalInitializers(), except prints a brief message to std::cerr + * and terminates the process on failure. + */ +void runGlobalInitializersOrDie(int argc, const char* const* argv, const char* const* envp); } // namespace mongo |