summaryrefslogtreecommitdiff
path: root/src/mongo/logger
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2015-06-10 17:43:13 -0400
committerAndrew Morrow <acm@mongodb.com>2015-06-10 22:37:44 -0400
commita9b6612f5322f916298c19a6728817a1034c6aab (patch)
tree0da5b1ce36e6a8e2d85dbdeb49d505ac99bf6e1d /src/mongo/logger
parent0ec1e625760eb9c1a20a3dba78200e8f9ff28d9e (diff)
downloadmongo-a9b6612f5322f916298c19a6728817a1034c6aab.tar.gz
SERVER-17309 Replace std::auto_ptr<T> with std::unique_ptr<T>
Diffstat (limited to 'src/mongo/logger')
-rw-r--r--src/mongo/logger/log_domain.h4
-rw-r--r--src/mongo/logger/log_test.cpp2
-rw-r--r--src/mongo/logger/rotatable_file_manager.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/logger/log_domain.h b/src/mongo/logger/log_domain.h
index f55f04dd6f4..715e5822ed0 100644
--- a/src/mongo/logger/log_domain.h
+++ b/src/mongo/logger/log_domain.h
@@ -81,7 +81,7 @@ namespace logger {
};
// TODO(schwerin): Replace with unique_ptr in C++11.
- typedef std::auto_ptr<EventAppender> AppenderAutoPtr;
+ typedef std::unique_ptr<EventAppender> AppenderAutoPtr;
LogDomain();
~LogDomain();
@@ -118,7 +118,7 @@ namespace logger {
/**
* Detaches the appender referenced by "handle" from this domain, releasing ownership of it.
- * Returns an auto_ptr to the handler to the caller, who is now responsible for its
+ * Returns an unique_ptr to the handler to the caller, who is now responsible for its
* deletion. Caller should consider "handle" is invalid after this call.
*/
AppenderAutoPtr detachAppender(AppenderHandle handle);
diff --git a/src/mongo/logger/log_test.cpp b/src/mongo/logger/log_test.cpp
index ca60eb28040..7983c6a4ea8 100644
--- a/src/mongo/logger/log_test.cpp
+++ b/src/mongo/logger/log_test.cpp
@@ -93,7 +93,7 @@ namespace {
ASSERT_EQUALS(0, dynamic_cast<CountAppender*>(countAppender.get())->getCount());
// Appending to the domain after attaching the appender does affect the appender.
- MessageLogDomain::AppenderHandle handle = domain.attachAppender(countAppender);
+ MessageLogDomain::AppenderHandle handle = domain.attachAppender(std::move(countAppender));
domain.append(MessageEventEphemeral(Date_t(), LogSeverity::Log(), "", "2"));
countAppender = domain.detachAppender(handle);
ASSERT_EQUALS(1, dynamic_cast<CountAppender*>(countAppender.get())->getCount());
diff --git a/src/mongo/logger/rotatable_file_manager.cpp b/src/mongo/logger/rotatable_file_manager.cpp
index c5e9a3245d6..88f95c37dbf 100644
--- a/src/mongo/logger/rotatable_file_manager.cpp
+++ b/src/mongo/logger/rotatable_file_manager.cpp
@@ -49,7 +49,7 @@ namespace logger {
return StatusWithRotatableFileWriter(ErrorCodes::FileAlreadyOpen,
"File \"" + fileName + "\" already opened.");
}
- std::auto_ptr<RotatableFileWriter> writer(new RotatableFileWriter);
+ std::unique_ptr<RotatableFileWriter> writer(new RotatableFileWriter);
RotatableFileWriter::Use writerUse(writer.get());
Status status = writerUse.setFileName(fileName, append);
if (!status.isOK())