aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/smtp/SMTPCommandSet.cpp
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
committerVincent Richard <[email protected]>2013-11-21 21:16:57 +0000
commitf9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8 (patch)
tree2bdc90e361a8f6e0a81164cf67afec9f78f9b959 /src/net/smtp/SMTPCommandSet.cpp
parentPer-protocol include files. (diff)
downloadvmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.tar.gz
vmime-f9913fa28a27f23fde2d4956c62cbb2fb2bc2ee8.zip
Boost/C++11 shared pointers.
Diffstat (limited to 'src/net/smtp/SMTPCommandSet.cpp')
-rw-r--r--src/net/smtp/SMTPCommandSet.cpp20
1 files changed, 10 insertions, 10 deletions
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> SMTPCommandSet::create(const bool pipeline)
+shared_ptr <SMTPCommandSet> SMTPCommandSet::create(const bool pipeline)
{
- return vmime::create <SMTPCommandSet>(pipeline);
+ return shared_ptr <SMTPCommandSet>(new SMTPCommandSet(pipeline));
}
-void SMTPCommandSet::addCommand(ref <SMTPCommand> cmd)
+void SMTPCommandSet::addCommand(shared_ptr <SMTPCommand> cmd)
{
if (m_started)
{
@@ -67,17 +67,17 @@ void SMTPCommandSet::addCommand(ref <SMTPCommand> cmd)
}
-void SMTPCommandSet::writeToSocket(ref <socket> sok)
+void SMTPCommandSet::writeToSocket(shared_ptr <socket> sok)
{
if (m_pipeline)
{
if (!m_started)
{
// Send all commands at once
- for (std::list <ref <SMTPCommand> >::const_iterator it = m_commands.begin() ;
+ for (std::list <shared_ptr <SMTPCommand> >::const_iterator it = m_commands.begin() ;
it != m_commands.end() ; ++it)
{
- ref <SMTPCommand> cmd = *it;
+ shared_ptr <SMTPCommand> cmd = *it;
cmd->writeToSocket(sok);
}
}
@@ -85,7 +85,7 @@ void SMTPCommandSet::writeToSocket(ref <socket> sok)
if (!m_commands.empty())
{
// Advance the pointer to last command sent
- ref <SMTPCommand> cmd = m_commands.front();
+ shared_ptr <SMTPCommand> cmd = m_commands.front();
m_commands.pop_front();
m_lastCommandSent = cmd;
@@ -96,7 +96,7 @@ void SMTPCommandSet::writeToSocket(ref <socket> sok)
if (!m_commands.empty())
{
// Send only one command
- ref <SMTPCommand> cmd = m_commands.front();
+ shared_ptr <SMTPCommand> 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 <ref <SMTPCommand> >::const_iterator it = m_commands.begin() ;
+ for (std::list <shared_ptr <SMTPCommand> >::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 <SMTPCommand> SMTPCommandSet::getLastCommandSent() const
+shared_ptr <SMTPCommand> SMTPCommandSet::getLastCommandSent() const
{
return m_lastCommandSent;
}