summaryrefslogtreecommitdiff
path: root/src/mongo/db/background.h
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-06-25 19:42:11 -0400
committerEliot Horowitz <eliot@10gen.com>2013-06-26 22:36:37 -0400
commit692f1859a032a92e54f08b1a2a130fa99590b1d0 (patch)
treecb5704667f7ec4254b3a837e2f2668cfbaacafe5 /src/mongo/db/background.h
parentbd0713e9a67f67b19944841275007f6fc6ee1c69 (diff)
downloadmongo-692f1859a032a92e54f08b1a2a130fa99590b1d0.tar.gz
clean NamespaceString so that it can be the thing passed around
Diffstat (limited to 'src/mongo/db/background.h')
-rw-r--r--src/mongo/db/background.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/mongo/db/background.h b/src/mongo/db/background.h
index 0b76abf3a8e..bfc48404fb3 100644
--- a/src/mongo/db/background.h
+++ b/src/mongo/db/background.h
@@ -21,7 +21,14 @@
#pragma once
+#include <map>
+#include <set>
+#include <string>
+#include <sstream>
+
+#include "mongo/base/string_data.h"
#include "mongo/db/namespacestring.h"
+#include "mongo/util/concurrency/mutex.h"
namespace mongo {
@@ -37,21 +44,21 @@ namespace mongo {
*/
class BackgroundOperation : public boost::noncopyable {
public:
- static bool inProgForDb(const char *db);
- static bool inProgForNs(const char *ns);
- static void assertNoBgOpInProgForDb(const char *db);
- static void assertNoBgOpInProgForNs(const char *ns);
- static void dump(stringstream&);
+ static bool inProgForDb(const StringData& db);
+ static bool inProgForNs(const StringData& ns);
+ static void assertNoBgOpInProgForDb(const StringData& db);
+ static void assertNoBgOpInProgForNs(const StringData& ns);
+ static void dump(std::stringstream&);
/* check for in progress before instantiating */
- BackgroundOperation(const char *ns);
+ BackgroundOperation(const StringData& ns);
virtual ~BackgroundOperation();
private:
NamespaceString _ns;
- static map<string, unsigned> dbsInProg;
- static set<string> nsInProg;
+ static std::map<std::string, unsigned> dbsInProg;
+ static std::set<std::string> nsInProg;
static SimpleMutex m;
};