From f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Thu, 21 Nov 2013 22:16:57 +0100 Subject: Boost/C++11 shared pointers. --- src/net/smtp/SMTPCommandSet.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/net/smtp/SMTPCommandSet.cpp') diff --git a/src/net/smtp/SMTPCommandSet.cpp b/src/net/smtp/SMTPCommandSet.cpp index a967c3a6..3e03427c 100644 --- a/src/net/smtp/SMTPCommandSet.cpp +++ b/src/net/smtp/SMTPCommandSet.cpp @@ -49,13 +49,13 @@ SMTPCommandSet::SMTPCommandSet(const bool pipeline) // static -ref SMTPCommandSet::create(const bool pipeline) +shared_ptr SMTPCommandSet::create(const bool pipeline) { - return vmime::create (pipeline); + return shared_ptr (new SMTPCommandSet(pipeline)); } -void SMTPCommandSet::addCommand(ref cmd) +void SMTPCommandSet::addCommand(shared_ptr cmd) { if (m_started) { @@ -67,17 +67,17 @@ void SMTPCommandSet::addCommand(ref cmd) } -void SMTPCommandSet::writeToSocket(ref sok) +void SMTPCommandSet::writeToSocket(shared_ptr sok) { if (m_pipeline) { if (!m_started) { // Send all commands at once - for (std::list >::const_iterator it = m_commands.begin() ; + for (std::list >::const_iterator it = m_commands.begin() ; it != m_commands.end() ; ++it) { - ref cmd = *it; + shared_ptr cmd = *it; cmd->writeToSocket(sok); } } @@ -85,7 +85,7 @@ void SMTPCommandSet::writeToSocket(ref sok) if (!m_commands.empty()) { // Advance the pointer to last command sent - ref cmd = m_commands.front(); + shared_ptr cmd = m_commands.front(); m_commands.pop_front(); m_lastCommandSent = cmd; @@ -96,7 +96,7 @@ void SMTPCommandSet::writeToSocket(ref sok) if (!m_commands.empty()) { // Send only one command - ref cmd = m_commands.front(); + shared_ptr cmd = m_commands.front(); m_commands.pop_front(); cmd->writeToSocket(sok); @@ -114,7 +114,7 @@ const string SMTPCommandSet::getText() const std::ostringstream cmd; cmd.imbue(std::locale::classic()); - for (std::list >::const_iterator it = m_commands.begin() ; + for (std::list >::const_iterator it = m_commands.begin() ; it != m_commands.end() ; ++it) { cmd << (*it)->getText() << "\r\n"; @@ -130,7 +130,7 @@ bool SMTPCommandSet::isFinished() const } -ref SMTPCommandSet::getLastCommandSent() const +shared_ptr SMTPCommandSet::getLastCommandSent() const { return m_lastCommandSent; } -- cgit v1.2.3