summaryrefslogtreecommitdiff
path: root/src/mongo/base/global_initializer.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@10gen.com>2012-09-17 12:19:26 -0400
committerAndy Schwerin <schwerin@10gen.com>2012-09-25 15:57:08 -0400
commit635aed09b0de72588422f1b864cca3810979375c (patch)
tree110365fc2105146c248025ef06e95db70ef3721b /src/mongo/base/global_initializer.h
parent1c9b2a7d236cce265db1b29a708959fe87ba56ca (diff)
downloadmongo-635aed09b0de72588422f1b864cca3810979375c.tar.gz
SERVER-5112 Introduce runGlobalInitializers(), macros and tools for global initializer declaration.
These utilities simplify adding global (process-wide) initializers that run at the beginning of main(). Also, run the global initializers in the main() of unittests.
Diffstat (limited to 'src/mongo/base/global_initializer.h')
-rw-r--r--src/mongo/base/global_initializer.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mongo/base/global_initializer.h b/src/mongo/base/global_initializer.h
new file mode 100644
index 00000000000..4f5609c2d89
--- /dev/null
+++ b/src/mongo/base/global_initializer.h
@@ -0,0 +1,29 @@
+/* Copyright 2012 10gen Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+namespace mongo {
+ class Initializer;
+
+ /**
+ * Get the process-global initializer object.
+ *
+ * See mongo/base/initializer.h and mongo/base/init.h for information about process
+ * initialization in mongo applications.
+ */
+ Initializer& getGlobalInitializer();
+
+} // namespace mongo