- switch to unique_ptr

This commit is contained in:
dmytro.bogovych 2019-06-03 20:03:07 +03:00
parent be40ebef7e
commit 31c876490c
37 changed files with 223 additions and 223 deletions

View File

@ -414,7 +414,7 @@ int Account::sendMsg(const std::string& peer, const void* ptr, unsigned length,
type = resip::Mime(resip::Data(mime), resip::Data());
resip::ClientPagerMessageHandle msgHandle = mAgent.mDum->makePagerMessage(resip::NameAddr(resip::Data(peer)), mProfile, s);
auto_ptr<resip::Contents> contentPtr(new resip::PlainContents(resip::Data(std::string((const char*)ptr, length)),type));
unique_ptr<resip::Contents> contentPtr(new resip::PlainContents(resip::Data(std::string((const char*)ptr, length)),type));
int result = s->sessionId();
msgHandle->page(contentPtr);

View File

@ -232,7 +232,7 @@ void UserAgent::start()
mDum->setMasterProfile(mProfile);
mDum->setClientRegistrationHandler(this);
mDum->setClientAuthManager(auto_ptr<resip::ClientAuthManager>(new resip::ClientAuthManager()));
mDum->setClientAuthManager(unique_ptr<resip::ClientAuthManager>(new resip::ClientAuthManager()));
mDum->addClientSubscriptionHandler(resip::Symbols::Presence, this);
mDum->addClientSubscriptionHandler(resip::Data("message-summary"), this);
@ -244,7 +244,7 @@ void UserAgent::start()
mDum->setClientPagerMessageHandler(this);
mDum->setServerPagerMessageHandler(this);
auto_ptr<resip::AppDialogSetFactory> uac_dsf(new ResipSessionFactory(this));
unique_ptr<resip::AppDialogSetFactory> uac_dsf(new ResipSessionFactory(this));
mDum->setAppDialogSetFactory(uac_dsf);
// Fire onStart event if stun is not used or stun server ip is known
@ -1471,7 +1471,7 @@ void UserAgent::onSuccess(resip::ClientPagerMessageHandle h, const resip::SipMes
onMessageSent(getAccount(status.header(resip::h_From)), s->sessionId(), s->remoteAddress(), s->tag());
}
void UserAgent::onFailure(resip::ClientPagerMessageHandle h, const resip::SipMessage& status, std::auto_ptr<resip::Contents> contents)
void UserAgent::onFailure(resip::ClientPagerMessageHandle h, const resip::SipMessage& status, std::unique_ptr<resip::Contents> contents)
{
if (!h.isValid())
return;

View File

@ -2,10 +2,10 @@
using namespace resip;
std::auto_ptr<ClientAuthExtension> ClientAuthExtension::mInstance = std::auto_ptr<ClientAuthExtension>(new ClientAuthExtension());
std::unique_ptr<ClientAuthExtension> ClientAuthExtension::mInstance = std::unique_ptr<ClientAuthExtension>(new ClientAuthExtension());
void
ClientAuthExtension::setInstance(std::auto_ptr<ClientAuthExtension> ext)
ClientAuthExtension::setInstance(std::unique_ptr<ClientAuthExtension> ext)
{
mInstance = ext;
}

View File

@ -413,7 +413,7 @@ ClientAuthManager::RealmState::addAuthentication(SipMessage& request)
// Add client auth decorator so that we ensure any body hashes are calcuated after user defined outbound decorators that
// may be modifying the message body
std::auto_ptr<MessageDecorator> clientAuthDecorator(new ClientAuthDecorator(mIsProxyCredential, mAuth, mCredential, authQop, nonceCountString));
std::unique_ptr<MessageDecorator> clientAuthDecorator(new ClientAuthDecorator(mIsProxyCredential, mAuth, mCredential, authQop, nonceCountString));
request.addOutboundDecorator(clientAuthDecorator);
}

View File

@ -36,7 +36,7 @@ ClientInviteSession::ClientInviteSession(DialogUsageManager& dum,
assert(request->isRequest());
if(initialOffer)
{
mProposedLocalOfferAnswer = auto_ptr<Contents>(initialOffer->clone());
mProposedLocalOfferAnswer = unique_ptr<Contents>(initialOffer->clone());
mProposedEncryptionLevel = level;
}
*mLastLocalSessionModification = *request; // Copy message, so that modifications to mLastLocalSessionModification don't effect creator->getLastRequest
@ -663,7 +663,7 @@ ClientInviteSession::dispatchStart (const SipMessage& msg)
assert(msg.header(h_CSeq).method() == INVITE);
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InviteSession::Event event = toEvent(msg, offerAnswer.get());
@ -793,7 +793,7 @@ void
ClientInviteSession::dispatchEarly (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -920,7 +920,7 @@ void
ClientInviteSession::dispatchAnswered (const SipMessage& msg)
{
//InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -972,7 +972,7 @@ void
ClientInviteSession::dispatchEarlyWithOffer (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1040,7 +1040,7 @@ void
ClientInviteSession::dispatchSentAnswer (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1101,7 +1101,7 @@ void
ClientInviteSession::dispatchQueuedUpdate (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1179,7 +1179,7 @@ void
ClientInviteSession::dispatchEarlyWithAnswer (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1258,7 +1258,7 @@ void
ClientInviteSession::dispatchSentUpdateEarly (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1322,7 +1322,7 @@ void
ClientInviteSession::dispatchSentUpdateEarlyGlare (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1364,7 +1364,7 @@ ClientInviteSession::dispatchReceivedUpdateEarly (const SipMessage& msg)
{
/*
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1382,7 +1382,7 @@ void
ClientInviteSession::dispatchCancelled (const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{

View File

@ -113,7 +113,7 @@ ClientPagerMessage::getMessageRequest()
}
void
ClientPagerMessage::page(std::auto_ptr<Contents> contents,
ClientPagerMessage::page(std::unique_ptr<Contents> contents,
DialogUsageManager::EncryptionLevel level)
{
assert(contents.get() != 0);
@ -132,7 +132,7 @@ class ClientPagerMessagePageCommand : public DumCommandAdapter
{
public:
ClientPagerMessagePageCommand(ClientPagerMessage& clientPagerMessage,
std::auto_ptr<Contents> contents,
std::unique_ptr<Contents> contents,
DialogUsageManager::EncryptionLevel level)
: mClientPagerMessage(clientPagerMessage),
mContents(contents),
@ -152,12 +152,12 @@ public:
}
private:
ClientPagerMessage& mClientPagerMessage;
std::auto_ptr<Contents> mContents;
std::unique_ptr<Contents> mContents;
DialogUsageManager::EncryptionLevel mLevel;
};
void
ClientPagerMessage::pageCommand(std::auto_ptr<Contents> contents,
ClientPagerMessage::pageCommand(std::unique_ptr<Contents> contents,
DialogUsageManager::EncryptionLevel level)
{
mDum.post(new ClientPagerMessagePageCommand(*this, contents, level));
@ -203,7 +203,7 @@ ClientPagerMessage::dispatch(const SipMessage& msg)
Contents* p = contents->contents;
WarningLog ( << "Paging failed " << *p );
Helper::makeResponse(errResponse, *mRequest, code);
handler->onFailure(getHandle(), errResponse, std::auto_ptr<Contents>(p));
handler->onFailure(getHandle(), errResponse, std::unique_ptr<Contents>(p));
contents->contents = 0;
}
mMsgQueue.clear();

View File

@ -322,7 +322,7 @@ public:
private:
ClientPublication& mClientPublication;
std::auto_ptr<Contents> mBody;
std::unique_ptr<Contents> mBody;
};
void

View File

@ -31,17 +31,17 @@ DialogEventInfo::DialogEventInfo(const DialogEventInfo& rhs)
{
if (rhs.mReplacesId.get())
{
mReplacesId = std::auto_ptr<DialogId>(new DialogId(rhs.mReplacesId->getCallId(),
mReplacesId = std::unique_ptr<DialogId>(new DialogId(rhs.mReplacesId->getCallId(),
rhs.mReplacesId->getLocalTag(),
rhs.mReplacesId->getRemoteTag()));
}
if (rhs.mLocalOfferAnswer.get())
{
mLocalOfferAnswer = std::auto_ptr<Contents>(rhs.mLocalOfferAnswer->clone());
mLocalOfferAnswer = std::unique_ptr<Contents>(rhs.mLocalOfferAnswer->clone());
}
if (rhs.mRemoteOfferAnswer.get())
{
mRemoteOfferAnswer = std::auto_ptr<Contents>(rhs.mRemoteOfferAnswer->clone());
mRemoteOfferAnswer = std::unique_ptr<Contents>(rhs.mRemoteOfferAnswer->clone());
}
}

View File

@ -26,11 +26,11 @@ DialogEventStateManager::onTryingUas(Dialog& dialog, const SipMessage& invite)
eventInfo->mDirection = DialogEventInfo::Recipient;
eventInfo->mCreationTimeSeconds = Timer::getTimeSecs();
eventInfo->mInviteSession = InviteSessionHandle::NotValid();
eventInfo->mRemoteOfferAnswer = (invite.getContents() != NULL ? std::auto_ptr<Contents>(invite.getContents()->clone()) : std::auto_ptr<Contents>());
eventInfo->mRemoteOfferAnswer = (invite.getContents() != NULL ? std::unique_ptr<Contents>(invite.getContents()->clone()) : std::unique_ptr<Contents>());
eventInfo->mLocalIdentity = dialog.getLocalNameAddr();
eventInfo->mLocalTarget = dialog.getLocalContact().uri(); // !slg! TODO - fix me - the Dialog stored local contact has an empty hostname so that the stack will fill it in
eventInfo->mRemoteIdentity = dialog.getRemoteNameAddr();
eventInfo->mRemoteTarget = std::auto_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
eventInfo->mRemoteTarget = std::unique_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
eventInfo->mRouteSet = dialog.getRouteSet();
eventInfo->mState = DialogEventInfo::Trying;
@ -40,7 +40,7 @@ DialogEventStateManager::onTryingUas(Dialog& dialog, const SipMessage& invite)
Data replacesToTag = invite.header(h_Replaces).exists(p_toTag) ? invite.header(h_Replaces).param(p_toTag) : Data::Empty;
Data replacesFromTag = invite.header(h_Replaces).exists(p_fromTag) ? invite.header(h_Replaces).param(p_fromTag) : Data::Empty;
eventInfo->mReplacesId = std::auto_ptr<DialogId>(new DialogId(invite.header(h_Replaces).value(),
eventInfo->mReplacesId = std::unique_ptr<DialogId>(new DialogId(invite.header(h_Replaces).value(),
replacesToTag,
replacesFromTag));
@ -53,7 +53,7 @@ DialogEventStateManager::onTryingUas(Dialog& dialog, const SipMessage& invite)
if (invite.exists(h_ReferredBy) &&
invite.header(h_ReferredBy).isWellFormed())
{
eventInfo->mReferredBy = std::auto_ptr<NameAddr>(new NameAddr(invite.header(h_ReferredBy)));
eventInfo->mReferredBy = std::unique_ptr<NameAddr>(new NameAddr(invite.header(h_ReferredBy)));
}
mDialogIdToEventInfo[dialog.getId()] = eventInfo;
@ -98,13 +98,13 @@ DialogEventStateManager::onTryingUac(DialogSet& dialogSet, const SipMessage& inv
assert(invite.header(h_Contacts).front().isWellFormed());
eventInfo->mLocalTarget = invite.header(h_Contacts).front().uri();
eventInfo->mRemoteIdentity = invite.header(h_To);
eventInfo->mLocalOfferAnswer = (invite.getContents() != NULL ? std::auto_ptr<Contents>(invite.getContents()->clone()) : std::auto_ptr<Contents>());
eventInfo->mLocalOfferAnswer = (invite.getContents() != NULL ? std::unique_ptr<Contents>(invite.getContents()->clone()) : std::unique_ptr<Contents>());
eventInfo->mState = DialogEventInfo::Trying;
if (invite.exists(h_ReferredBy) &&
invite.header(h_ReferredBy).isWellFormed())
{
eventInfo->mReferredBy = std::auto_ptr<NameAddr>(new NameAddr(invite.header(h_ReferredBy)));
eventInfo->mReferredBy = std::unique_ptr<NameAddr>(new NameAddr(invite.header(h_ReferredBy)));
}
mDialogIdToEventInfo[eventInfo->mDialogId] = eventInfo;
@ -132,7 +132,7 @@ DialogEventStateManager::onProceedingUac(const DialogSet& dialogSet, const SipMe
// ?bwc? Has something already checked for well-formedness here?
// Maybe DialogSet? Assert for now.
assert(response.header(h_Contacts).front().isWellFormed());
eventInfo->mRemoteTarget = std::auto_ptr<Uri>(new Uri(response.header(h_Contacts).front().uri()));
eventInfo->mRemoteTarget = std::unique_ptr<Uri>(new Uri(response.header(h_Contacts).front().uri()));
}
ProceedingDialogEvent evt(*eventInfo);
mDialogEventHandler->onProceeding(evt);
@ -162,7 +162,7 @@ DialogEventStateManager::onEarly(const Dialog& dialog, InviteSessionHandle is)
// local or remote target might change due to an UPDATE or re-INVITE
eventInfo->mLocalTarget = dialog.getLocalContact().uri(); // !slg! TODO - fix me - the Dialog stored local contact has an empty hostname so that the stack will fill it in
eventInfo->mRemoteTarget = std::auto_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
eventInfo->mRemoteTarget = std::unique_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
EarlyDialogEvent evt(*eventInfo);
mDialogEventHandler->onEarly(evt);
@ -183,7 +183,7 @@ DialogEventStateManager::onConfirmed(const Dialog& dialog, InviteSessionHandle i
// local or remote target might change due to an UPDATE or re-INVITE
eventInfo->mLocalTarget = dialog.getLocalContact().uri(); // !slg! TODO - fix me - the Dialog stored local contact has an empty hostname so that the stack will fill it in
eventInfo->mRemoteTarget = std::auto_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
eventInfo->mRemoteTarget = std::unique_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
// for the dialog that got the 200 OK
SharedPtr<ConfirmedDialogEvent> confirmedEvt(new ConfirmedDialogEvent(*eventInfo));
@ -239,7 +239,7 @@ DialogEventStateManager::onTerminated(const Dialog& dialog, const SipMessage& ms
{
// .jjg. we're killing a *specific* dialog *after* the successful completion of the initial INVITE transaction;
// so just elminate this dialog, not the entire dialogset
std::auto_ptr<TerminatedDialogEvent> evt(onDialogTerminatedImpl(it->second, reason, getResponseCode(msg), getFrontContact(msg)));
std::unique_ptr<TerminatedDialogEvent> evt(onDialogTerminatedImpl(it->second, reason, getResponseCode(msg), getFrontContact(msg)));
mDialogEventHandler->onTerminated(*evt);
delete it->second;
mDialogIdToEventInfo.erase(it++);
@ -283,7 +283,7 @@ DialogEventStateManager::onDialogSetTerminatedImpl(const DialogSetId& dialogSetI
it->first.getDialogSetId() == dialogSetId)
{
eventInfo = it->second;
std::auto_ptr<TerminatedDialogEvent> evt(onDialogTerminatedImpl(eventInfo, reason, getResponseCode(msg), getFrontContact(msg)));
std::unique_ptr<TerminatedDialogEvent> evt(onDialogTerminatedImpl(eventInfo, reason, getResponseCode(msg), getFrontContact(msg)));
mDialogEventHandler->onTerminated(*evt);
delete it->second;
mDialogIdToEventInfo.erase(it++);
@ -311,7 +311,7 @@ DialogEventStateManager::onDialogTerminatedImpl(DialogEventInfo* eventInfo,
if (remoteTarget)
{
eventInfo->mRemoteTarget = std::auto_ptr<Uri>(remoteTarget);
eventInfo->mRemoteTarget = std::unique_ptr<Uri>(remoteTarget);
}
TerminatedDialogEvent* evt = new TerminatedDialogEvent(*eventInfo, actualReason, responseCode);
@ -403,7 +403,7 @@ DialogEventStateManager::findOrCreateDialogInfo(const Dialog& dialog)
newForkInfo->mCreationTimeSeconds = Timer::getTimeSecs();
newForkInfo->mDialogId = dialog.getId();
newForkInfo->mRemoteIdentity = dialog.getRemoteNameAddr();
newForkInfo->mRemoteTarget = std::auto_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
newForkInfo->mRemoteTarget = std::unique_ptr<Uri>(new Uri(dialog.getRemoteTarget().uri()));
newForkInfo->mRouteSet = dialog.getRouteSet();
eventInfo = newForkInfo;
}

View File

@ -292,7 +292,7 @@ DialogUsageManager::forceShutdown(DumShutdownHandler* h)
DialogUsageManager::onAllHandlesDestroyed();
}
void DialogUsageManager::setAppDialogSetFactory(std::auto_ptr<AppDialogSetFactory> factory)
void DialogUsageManager::setAppDialogSetFactory(std::unique_ptr<AppDialogSetFactory> factory)
{
mAppDialogSetFactory = factory;
}
@ -318,13 +318,13 @@ void DialogUsageManager::setMasterProfile(const SharedPtr<MasterProfile>& master
mMasterUserProfile = masterProfile; // required so that we can return a reference to SharedPtr<UserProfile> in getMasterUserProfile
}
void DialogUsageManager::setKeepAliveManager(std::auto_ptr<KeepAliveManager> manager)
void DialogUsageManager::setKeepAliveManager(std::unique_ptr<KeepAliveManager> manager)
{
mKeepAliveManager = manager;
mKeepAliveManager->setDialogUsageManager(this);
}
void DialogUsageManager::setRedirectManager(std::auto_ptr<RedirectManager> manager)
void DialogUsageManager::setRedirectManager(std::unique_ptr<RedirectManager> manager)
{
mRedirectManager = manager;
}
@ -340,7 +340,7 @@ RedirectHandler* DialogUsageManager::getRedirectHandler()
}
void
DialogUsageManager::setClientAuthManager(std::auto_ptr<ClientAuthManager> manager)
DialogUsageManager::setClientAuthManager(std::unique_ptr<ClientAuthManager> manager)
{
mClientAuthManager = manager;
}
@ -393,7 +393,7 @@ DialogUsageManager::setRegistrationPersistenceManager(RegistrationPersistenceMan
}
void
DialogUsageManager::setRemoteCertStore(auto_ptr<RemoteCertStore> store)
DialogUsageManager::setRemoteCertStore(unique_ptr<RemoteCertStore> store)
{
}
@ -924,7 +924,7 @@ DialogUsageManager::send(SharedPtr<SipMessage> msg)
SharedPtr<MessageDecorator> outboundDecorator = userProfile->getOutboundDecorator();
if (outboundDecorator.get())
{
msg->addOutboundDecorator(std::auto_ptr<MessageDecorator>(outboundDecorator->clone()));
msg->addOutboundDecorator(std::unique_ptr<MessageDecorator>(outboundDecorator->clone()));
}
else
{
@ -987,7 +987,7 @@ DialogUsageManager::send(SharedPtr<SipMessage> msg)
DebugLog (<< "SEND: " << std::endl << std::endl << *msg);
OutgoingEvent* event = new OutgoingEvent(msg);
outgoingProcess(auto_ptr<Message>(event));
outgoingProcess(unique_ptr<Message>(event));
}
void
@ -998,7 +998,7 @@ DialogUsageManager::sendCommand(SharedPtr<SipMessage> request)
}
void DialogUsageManager::outgoingProcess(auto_ptr<Message> message)
void DialogUsageManager::outgoingProcess(unique_ptr<Message> message)
{
Data tid = Data::Empty;
{
@ -1073,10 +1073,10 @@ void DialogUsageManager::outgoingProcess(auto_ptr<Message> message)
assert(userProfile);
//!dcm! -- unique SharedPtr to auto_ptr conversion prob. a worthwhile
//!dcm! -- unique SharedPtr to unique_ptr conversion prob. a worthwhile
//optimzation here. SharedPtr would have to be changed; would
//throw/assert if not unique.
std::auto_ptr<SipMessage> toSend(static_cast<SipMessage*>(event->message()->clone()));
std::unique_ptr<SipMessage> toSend(static_cast<SipMessage*>(event->message()->clone()));
// .bwc. Protect ourselves from garbage with an isWellFormed() check.
// (Code in Dialog doesn't check for well-formedness in the
@ -1102,7 +1102,7 @@ void DialogUsageManager::outgoingProcess(auto_ptr<Message> message)
}
void
DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, auto_ptr<SipMessage> msg)
DialogUsageManager::sendUsingOutboundIfAppropriate(UserProfile& userProfile, unique_ptr<SipMessage> msg)
{
//a little inefficient, branch parameter might be better
DialogId id(*msg);
@ -1308,7 +1308,7 @@ AppDialogSetHandle DialogUsageManager::findAppDialogSet(const DialogSetId& id)
}
void
DialogUsageManager::internalProcess(std::auto_ptr<Message> msg)
DialogUsageManager::internalProcess(std::unique_ptr<Message> msg)
{
#ifdef RESIP_DUM_THREAD_DEBUG
if(!mThreadDebugKey)
@ -1499,7 +1499,7 @@ DialogUsageManager::processExternalMessage(ExternalMessageBase* externalMessage)
}
void
DialogUsageManager::incomingProcess(std::auto_ptr<Message> msg)
DialogUsageManager::incomingProcess(std::unique_ptr<Message> msg)
{
//call or create feature chain if appropriate
Data tid = Data::Empty;
@ -1680,7 +1680,7 @@ DialogUsageManager::process(resip::Lockable* mutex)
#ifdef RESIP_DUM_THREAD_DEBUG
mThreadDebugKey=mHiddenThreadDebugKey;
#endif
internalProcess(std::auto_ptr<Message>(mFifo.getNext()));
internalProcess(std::unique_ptr<Message>(mFifo.getNext()));
#ifdef RESIP_DUM_THREAD_DEBUG
// .bwc. Thread checking is disabled if mThreadDebugKey is 0; if the app
// is using this mutex-locked process() call, we only enable thread-
@ -1698,7 +1698,7 @@ DialogUsageManager::process(resip::Lockable* mutex)
bool
DialogUsageManager::process(int timeoutMs, resip::Lockable* mutex)
{
std::auto_ptr<Message> message;
std::unique_ptr<Message> message;
if(timeoutMs == -1)
{

View File

@ -16,7 +16,7 @@ DumFeature::~DumFeature()
{
}
void DumFeature::postCommand(std::auto_ptr<Message> message)
void DumFeature::postCommand(std::unique_ptr<Message> message)
{
mDum.post(new TargetCommand(mTarget, message));
}

View File

@ -12,7 +12,7 @@ void DumHelper::setOutgoingEncryptionLevel(SipMessage& message,
{
SecurityAttributes* attr = new SecurityAttributes();
attr->setOutgoingEncryptionLevel(convert(level));
message.setSecurityAttributes(auto_ptr<SecurityAttributes>(attr));
message.setSecurityAttributes(unique_ptr<SecurityAttributes>(attr));
}
void DumHelper::setEncryptionPerformed(SipMessage& message)
@ -20,7 +20,7 @@ void DumHelper::setEncryptionPerformed(SipMessage& message)
SecurityAttributes* attr = new SecurityAttributes();
attr->setOutgoingEncryptionLevel(message.getSecurityAttributes()->getOutgoingEncryptionLevel());
attr->setEncryptionPerformed(true);
message.setSecurityAttributes(auto_ptr<SecurityAttributes>(attr));
message.setSecurityAttributes(unique_ptr<SecurityAttributes>(attr));
}
SecurityAttributes::OutgoingEncryptionLevel DumHelper::convert(DialogUsageManager::EncryptionLevel level)

View File

@ -18,7 +18,7 @@ DumThread::thread()
{
try
{
std::auto_ptr<Message> msg(mDum.mFifo.getNext(1000)); // Only need to wake up to see if we are shutdown
std::unique_ptr<Message> msg(mDum.mFifo.getNext(1000)); // Only need to wake up to see if we are shutdown
if (msg.get())
{
mDum.internalProcess(msg);

View File

@ -4,11 +4,11 @@
using namespace resip;
HttpProvider* HttpProvider::mInstance = 0;
std::auto_ptr<HttpProviderFactory> HttpProvider::mFactory;
std::unique_ptr<HttpProviderFactory> HttpProvider::mFactory;
Mutex HttpProvider::mMutex;
void
HttpProvider::setFactory(std::auto_ptr<HttpProviderFactory> fact)
HttpProvider::setFactory(std::unique_ptr<HttpProviderFactory> fact)
{
mFactory = fact;
}

View File

@ -98,7 +98,7 @@ IdentityHandler::queueForIdentityCheck(SipMessage* sipMsg)
}
#endif
std::auto_ptr<SecurityAttributes> sec(new SecurityAttributes);
std::unique_ptr<SecurityAttributes> sec(new SecurityAttributes);
sec->setIdentity(sipMsg->header(h_From).uri().getAor());
sec->setIdentityStrength(SecurityAttributes::From);
sipMsg->setSecurityAttributes(sec);
@ -114,7 +114,7 @@ IdentityHandler::processIdentityCheckResponse(const HttpGetMessage& msg)
if (it != mRequiresCerts.end())
{
mDum.getSecurity()->checkAndSetIdentity( *it->second, msg.getBodyData() );
postCommand(auto_ptr<Message>(it->second));
postCommand(unique_ptr<Message>(it->second));
mRequiresCerts.erase(it);
}
#endif

View File

@ -507,9 +507,9 @@ public:
}
private:
InviteSession& mInviteSession;
std::auto_ptr<const Contents> mOffer;
std::unique_ptr<const Contents> mOffer;
DialogUsageManager::EncryptionLevel mLevel;
std::auto_ptr<const Contents> mAlternative;
std::unique_ptr<const Contents> mAlternative;
};
void
@ -544,7 +544,7 @@ public:
}
private:
InviteSession& mInviteSession;
std::auto_ptr<const Contents> mOffer;
std::unique_ptr<const Contents> mOffer;
};
void
@ -621,7 +621,7 @@ public:
}
private:
InviteSession& mInviteSession;
std::auto_ptr<const Contents> mAnswer;
std::unique_ptr<const Contents> mAnswer;
};
void
@ -813,7 +813,7 @@ public:
private:
InviteSession& mInviteSession;
int mCode;
std::auto_ptr<WarningCategory> mWarning;
std::unique_ptr<WarningCategory> mWarning;
};
void
@ -840,10 +840,10 @@ InviteSession::targetRefresh(const NameAddr& localUri)
void
InviteSession::refer(const NameAddr& referTo, bool referSub)
{
refer(referTo,std::auto_ptr<resip::Contents>(0),referSub);
refer(referTo,std::unique_ptr<resip::Contents>(0),referSub);
}
void
InviteSession::refer(const NameAddr& referTo, std::auto_ptr<resip::Contents> contents,bool referSub)
InviteSession::refer(const NameAddr& referTo, std::unique_ptr<resip::Contents> contents,bool referSub)
{
if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite?
{
@ -938,11 +938,11 @@ InviteSession::referCommand(const NameAddr& referTo, bool referSub)
void
InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, bool referSub)
{
refer(referTo,sessionToReplace,std::auto_ptr<resip::Contents>(0),referSub);
refer(referTo,sessionToReplace,std::unique_ptr<resip::Contents>(0),referSub);
}
void
InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::auto_ptr<resip::Contents> contents, bool referSub)
InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToReplace, std::unique_ptr<resip::Contents> contents, bool referSub)
{
if (!sessionToReplace.isValid())
{
@ -961,11 +961,11 @@ InviteSession::refer(const NameAddr& referTo, InviteSessionHandle sessionToRepla
void
InviteSession::refer(const NameAddr& referTo, const CallId& replaces, bool referSub)
{
refer(referTo,replaces,std::auto_ptr<resip::Contents>(0),referSub);
refer(referTo,replaces,std::unique_ptr<resip::Contents>(0),referSub);
}
void
InviteSession::refer(const NameAddr& referTo, const CallId& replaces, std::auto_ptr<resip::Contents> contents, bool referSub)
InviteSession::refer(const NameAddr& referTo, const CallId& replaces, std::unique_ptr<resip::Contents> contents, bool referSub)
{
if (isConnected()) // ?slg? likely not safe in any state except Connected - what should behaviour be if state is ReceivedReinvite?
{
@ -1078,7 +1078,7 @@ public:
}
private:
InviteSession& mInviteSession;
std::auto_ptr<Contents> mContents;
std::unique_ptr<Contents> mContents;
};
void
@ -1128,7 +1128,7 @@ public:
}
private:
InviteSession& mInviteSession;
std::auto_ptr<Contents> mContents;
std::unique_ptr<Contents> mContents;
};
@ -1365,7 +1365,7 @@ void
InviteSession::dispatchConnected(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1440,7 +1440,7 @@ void
InviteSession::dispatchSentUpdate(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1523,7 +1523,7 @@ void
InviteSession::dispatchSentReinvite(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1644,7 +1644,7 @@ void
InviteSession::dispatchSentReinviteNoOffer(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1739,7 +1739,7 @@ void
InviteSession::dispatchReceivedReinviteSentOffer(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1839,7 +1839,7 @@ void
InviteSession::dispatchReceivedUpdateOrReinvite(const SipMessage& msg)
{
// InviteSessionHandler* handler = mDum.mInviteSessionHandler; // unused
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1966,7 +1966,7 @@ InviteSession::dispatchWaitingToTerminate(const SipMessage& msg)
void
InviteSession::dispatchWaitingToHangup(const SipMessage& msg)
{
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -2239,7 +2239,7 @@ public:
private:
InviteSession& mInviteSession;
int mStatusCode;
std::auto_ptr<Contents> mContents;
std::unique_ptr<Contents> mContents;
};
void
@ -2744,34 +2744,34 @@ InviteSession::isReliable(const SipMessage& msg)
}
}
//static std::auto_ptr<SdpContents> emptySdp;
std::auto_ptr<Contents>
//static std::unique_ptr<SdpContents> emptySdp;
std::unique_ptr<Contents>
InviteSession::getOfferAnswer(const SipMessage& msg)
{
if(mDum.mInviteSessionHandler->isGenericOfferAnswer())
{
if(msg.getContents())
{
return std::auto_ptr<Contents>(msg.getContents()->clone());
return std::unique_ptr<Contents>(msg.getContents()->clone());
}
else
{
return std::auto_ptr<Contents>();
return std::unique_ptr<Contents>();
}
}
else
{
return std::auto_ptr<Contents>(Helper::getSdp(msg.getContents()));
return std::unique_ptr<Contents>(Helper::getSdp(msg.getContents()));
}
}
std::auto_ptr<Contents>
std::unique_ptr<Contents>
InviteSession::makeOfferAnswer(const Contents& offerAnswer)
{
return std::auto_ptr<Contents>(static_cast<Contents*>(offerAnswer.clone()));
return std::unique_ptr<Contents>(static_cast<Contents*>(offerAnswer.clone()));
}
auto_ptr<Contents>
unique_ptr<Contents>
InviteSession::makeOfferAnswer(const Contents& offerAnswer,
const Contents* alternative)
{
@ -2780,11 +2780,11 @@ InviteSession::makeOfferAnswer(const Contents& offerAnswer,
MultipartAlternativeContents* mac = new MultipartAlternativeContents;
mac->parts().push_back(alternative->clone());
mac->parts().push_back(offerAnswer.clone());
return auto_ptr<Contents>(mac);
return unique_ptr<Contents>(mac);
}
else
{
return auto_ptr<Contents>(offerAnswer.clone());
return unique_ptr<Contents>(offerAnswer.clone());
}
}
@ -2800,7 +2800,7 @@ InviteSession::setOfferAnswer(SipMessage& msg, const Contents& offerAnswer, cons
MultipartAlternativeContents* mac = new MultipartAlternativeContents;
mac->parts().push_back(alternative->clone());
mac->parts().push_back(offerAnswer.clone());
msg.setContents(auto_ptr<Contents>(mac));
msg.setContents(unique_ptr<Contents>(mac));
}
else
{
@ -3115,16 +3115,16 @@ InviteSession::setCurrentLocalOfferAnswer(const SipMessage& msg)
{
if (DialogUsageManager::Encrypt == getEncryptionLevel(msg) || DialogUsageManager::SignAndEncrypt == getEncryptionLevel(msg))
{
mCurrentLocalOfferAnswer = auto_ptr<Contents>(static_cast<Contents*>((dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))->parts().back()->clone()));
mCurrentLocalOfferAnswer = unique_ptr<Contents>(static_cast<Contents*>((dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))->parts().back()->clone()));
}
else
{
mCurrentLocalOfferAnswer = auto_ptr<Contents>(static_cast<Contents*>((dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))->parts().front()->clone()));
mCurrentLocalOfferAnswer = unique_ptr<Contents>(static_cast<Contents*>((dynamic_cast<MultipartAlternativeContents*>(mProposedLocalOfferAnswer.get()))->parts().front()->clone()));
}
}
else
{
mCurrentLocalOfferAnswer = auto_ptr<Contents>(static_cast<Contents*>(mProposedLocalOfferAnswer.get()->clone()));
mCurrentLocalOfferAnswer = unique_ptr<Contents>(static_cast<Contents*>(mProposedLocalOfferAnswer.get()->clone()));
}
mProposedLocalOfferAnswer.reset();
}

View File

@ -37,7 +37,7 @@ InviteSessionCreator::InviteSessionCreator(DialogUsageManager& dum,
}
}
std::auto_ptr<Contents> initialOffer;
std::unique_ptr<Contents> initialOffer;
if (initial)
{
if (alternative)

View File

@ -65,7 +65,7 @@ ServerAuthManager::process(Message* msg)
InfoLog(<< "ServerAuth got ChallengeInfo " << challengeInfo->brief());
MessageMap::iterator it = mMessages.find(challengeInfo->getTransactionId());
assert(it != mMessages.end());
std::auto_ptr<SipMessage> sipMsg(it->second);
std::unique_ptr<SipMessage> sipMsg(it->second);
mMessages.erase(it);
if(challengeInfo->isFailed())
@ -88,7 +88,7 @@ ServerAuthManager::process(Message* msg)
else
{
// challenge is not required, re-instate original message
postCommand(auto_ptr<Message>(sipMsg));
postCommand(unique_ptr<Message>(sipMsg));
return FeatureDoneAndEventDone;
}
}
@ -103,7 +103,7 @@ ServerAuthManager::process(Message* msg)
Message* result = handleUserAuthInfo(userAuth);
if (result)
{
postCommand(auto_ptr<Message>(result));
postCommand(unique_ptr<Message>(result));
return FeatureDoneAndEventDone;
}
else

View File

@ -726,7 +726,7 @@ ServerInviteSession::dispatchStart(const SipMessage& msg)
assert(msg.header(h_CSeq).method() == INVITE);
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
storePeerCapabilities(msg);
if (mDum.mDialogEventStateManager)
@ -786,7 +786,7 @@ ServerInviteSession::dispatchStart(const SipMessage& msg)
void
ServerInviteSession::dispatchOfferOrEarly(const SipMessage& msg)
{
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
case OnCancel:
@ -806,7 +806,7 @@ void
ServerInviteSession::dispatchAccepted(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InfoLog (<< "dispatchAccepted: " << msg.brief());
switch (toEvent(msg, offerAnswer.get()))
@ -868,7 +868,7 @@ void
ServerInviteSession::dispatchWaitingToOffer(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InfoLog (<< "dispatchWaitingToOffer: " << msg.brief());
switch (toEvent(msg, offerAnswer.get()))
@ -937,7 +937,7 @@ void
ServerInviteSession::dispatchWaitingToRequestOffer(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
InfoLog (<< "dispatchWaitingToRequestOffer: " << msg.brief());
switch (toEvent(msg, offerAnswer.get()))
@ -1005,7 +1005,7 @@ void
ServerInviteSession::dispatchAcceptedWaitingAnswer(const SipMessage& msg)
{
InviteSessionHandler* handler = mDum.mInviteSessionHandler;
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{
@ -1131,7 +1131,7 @@ ServerInviteSession::dispatchWaitingToTerminate(const SipMessage& msg)
void
ServerInviteSession::dispatchWaitingToHangup(const SipMessage& msg)
{
std::auto_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
std::unique_ptr<Contents> offerAnswer = InviteSession::getOfferAnswer(msg);
switch (toEvent(msg, offerAnswer.get()))
{

View File

@ -85,8 +85,8 @@ ServerRegistration::accept(SipMessage& ok)
}
else
{
std::auto_ptr<ContactRecordTransactionLog> log;
std::auto_ptr<ContactPtrList> contacts;
std::unique_ptr<ContactRecordTransactionLog> log;
std::unique_ptr<ContactPtrList> contacts;
mAsyncLocalStore->releaseLog(log,contacts);
@ -111,8 +111,8 @@ ServerRegistration::accept(SipMessage& ok)
//receive a final contact list before sending the 200.
mAsyncState = asyncStateAcceptedWaitingForFinalContactList;
std::auto_ptr<ContactRecordTransactionLog> log;
std::auto_ptr<ContactPtrList> modifiedContacts;
std::unique_ptr<ContactRecordTransactionLog> log;
std::unique_ptr<ContactPtrList> modifiedContacts;
mAsyncLocalStore->releaseLog(log,modifiedContacts);
@ -612,7 +612,7 @@ ServerRegistration::asyncProcessFinalOkMsg(SipMessage &msg, ContactPtrList &cont
ContactPtrList::iterator it(contacts.begin());
ContactPtrList::iterator itEnd(contacts.end());
std::auto_ptr<ContactPtrList> expired;
std::unique_ptr<ContactPtrList> expired;
UInt64 now=Timer::getTimeSecs();
@ -630,7 +630,7 @@ ServerRegistration::asyncProcessFinalOkMsg(SipMessage &msg, ContactPtrList &cont
{
if (!expired.get())
{
expired = std::auto_ptr<ContactPtrList>(new ContactPtrList());
expired = std::unique_ptr<ContactPtrList>(new ContactPtrList());
}
expired->push_back(rec);
continue;
@ -677,7 +677,7 @@ ServerRegistration::processFinalOkMsg(SipMessage &msg, ContactList &contacts)
}
bool
ServerRegistration::asyncProvideContacts(std::auto_ptr<resip::ContactPtrList> contacts)
ServerRegistration::asyncProvideContacts(std::unique_ptr<resip::ContactPtrList> contacts)
{
switch (mAsyncState)
{
@ -711,7 +711,7 @@ ServerRegistration::asyncProvideContacts(std::auto_ptr<resip::ContactPtrList> co
}
void
ServerRegistration::asyncProcessFinalContacts(std::auto_ptr<resip::ContactPtrList> contacts)
ServerRegistration::asyncProcessFinalContacts(std::unique_ptr<resip::ContactPtrList> contacts)
{
if (contacts.get())
{
@ -732,10 +732,10 @@ ServerRegistration::asyncProcessFinalContacts(std::auto_ptr<resip::ContactPtrLis
}
void
ServerRegistration::AsyncLocalStore::create(std::auto_ptr<ContactPtrList> originalContacts)
ServerRegistration::AsyncLocalStore::create(std::unique_ptr<ContactPtrList> originalContacts)
{
mModifiedContacts = originalContacts;
mLog = std::auto_ptr<ContactRecordTransactionLog>(new ContactRecordTransactionLog());
mLog = std::unique_ptr<ContactRecordTransactionLog>(new ContactRecordTransactionLog());
}
void

View File

@ -7,7 +7,7 @@ using namespace std;
TargetCommand::TargetCommand(Target& target,
auto_ptr<Message> message)
unique_ptr<Message> message)
: mTarget(target),
mMessage(message)
{

View File

@ -66,7 +66,7 @@ EncryptionManager::~EncryptionManager()
mRequests.clear();
}
void EncryptionManager::setRemoteCertStore(std::auto_ptr<RemoteCertStore> store)
void EncryptionManager::setRemoteCertStore(std::unique_ptr<RemoteCertStore> store)
{
ErrLog(<< "Async currently is not supported");
assert(0);
@ -149,7 +149,7 @@ DumFeature::ProcessingResult EncryptionManager::process(Message* msg)
{
if (setContents)
{
event->message()->setContents(auto_ptr<Contents>(contents));
event->message()->setContents(unique_ptr<Contents>(contents));
DumHelper::setEncryptionPerformed(*event->message());
}
return DumFeature::FeatureDone;
@ -438,11 +438,11 @@ EncryptionManager::Result EncryptionManager::Sign::received(bool success,
{
InfoLog(<< "Signing message" << endl);
MultipartSignedContents* msc = mDum.getSecurity()->sign(aor, mMsgToEncrypt->getContents());
mMsgToEncrypt->setContents(auto_ptr<Contents>(msc));
mMsgToEncrypt->setContents(unique_ptr<Contents>(msc));
DumHelper::setEncryptionPerformed(*mMsgToEncrypt);
OutgoingEvent* event = new OutgoingEvent(mMsgToEncrypt);
//mTaken = false;
mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), auto_ptr<Message>(event)));
mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), unique_ptr<Message>(event)));
result = Complete;
}
}
@ -533,11 +533,11 @@ EncryptionManager::Result EncryptionManager::Encrypt::received(bool success,
--mPendingRequests;
InfoLog(<< "Encrypting message" << endl);
Pkcs7Contents* encrypted = mDum.getSecurity()->encrypt(mMsgToEncrypt->getContents(), aor);
mMsgToEncrypt->setContents(auto_ptr<Contents>(encrypted));
mMsgToEncrypt->setContents(unique_ptr<Contents>(encrypted));
DumHelper::setEncryptionPerformed(*mMsgToEncrypt);
OutgoingEvent* event = new OutgoingEvent(mMsgToEncrypt);
//mTaken = false;
mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), auto_ptr<Message>(event)));
mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), unique_ptr<Message>(event)));
}
else
{
@ -641,11 +641,11 @@ EncryptionManager::Result EncryptionManager::SignAndEncrypt::received(bool succe
{
InfoLog(<< "Encrypting and signing message" << endl);
Contents* contents = doWork();
mMsgToEncrypt->setContents(auto_ptr<Contents>(contents));
mMsgToEncrypt->setContents(unique_ptr<Contents>(contents));
DumHelper::setEncryptionPerformed(*mMsgToEncrypt);
OutgoingEvent* event = new OutgoingEvent(mMsgToEncrypt);
//mTaken = false;
mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), auto_ptr<Message>(event)));
mDum.post(new TargetCommand(mDum.dumOutgoingTarget(), unique_ptr<Message>(event)));
result = Complete;
}
}
@ -925,7 +925,7 @@ bool EncryptionManager::Decrypt::isEncryptedRecurse(Contents** contents)
if (*contents == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(mps)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(mps)));
}
else
{
@ -950,7 +950,7 @@ bool EncryptionManager::Decrypt::isEncryptedRecurse(Contents** contents)
ErrLog(<< e.name() << endl << e.getMessage());
if (*contents == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(alt)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(alt)));
}
else
{
@ -1022,7 +1022,7 @@ bool EncryptionManager::Decrypt::isSignedRecurse(Contents** contents,
{
if (*contents == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(decrypted));
mMsgToDecrypt->setContents(unique_ptr<Contents>(decrypted));
*contents = mMsgToDecrypt->getContents();
}
else
@ -1040,7 +1040,7 @@ bool EncryptionManager::Decrypt::isSignedRecurse(Contents** contents,
if (*contents == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(decrypted)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(decrypted)));
}
else
{
@ -1076,7 +1076,7 @@ bool EncryptionManager::Decrypt::isSignedRecurse(Contents** contents,
if (*contents == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(alt)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(alt)));
}
else
{
@ -1127,8 +1127,8 @@ Helper::ContentsSecAttrs EncryptionManager::Decrypt::getContents(SipMessage* mes
}
}
std::auto_ptr<Contents> c(contents);
std::auto_ptr<SecurityAttributes> a(attr);
std::unique_ptr<Contents> c(contents);
std::unique_ptr<SecurityAttributes> a(attr);
return Helper::ContentsSecAttrs(c, a);
}
@ -1167,7 +1167,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree,
{
if (*tree == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(contents));
mMsgToDecrypt->setContents(unique_ptr<Contents>(contents));
*tree = mMsgToDecrypt->getContents();
}
else
@ -1189,7 +1189,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree,
if (*tree == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(contents)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(contents)));
}
else
{
@ -1233,7 +1233,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree,
if (*tree == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(alt)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(alt)));
}
else
{
@ -1272,7 +1272,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree,
if (*tree == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(mult)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(mult)));
}
else
{
@ -1300,7 +1300,7 @@ Contents* EncryptionManager::Decrypt::getContentsRecurse(Contents** tree,
if (*tree == mMsgToDecrypt->getContents())
{
mMsgToDecrypt->setContents(auto_ptr<Contents>(createInvalidContents(*tree)));
mMsgToDecrypt->setContents(unique_ptr<Contents>(createInvalidContents(*tree)));
}
else
{
@ -1341,7 +1341,7 @@ EncryptionManager::Decrypt::handleInvalidContents()
{
DebugLog(<< "No valid contents in the request" << endl);
InvalidContents* invalid = new InvalidContents(mOriginalMsgContents, mOriginalMsgContentsType);
mMsgToDecrypt->setContents(auto_ptr<Contents>(invalid));
mMsgToDecrypt->setContents(unique_ptr<Contents>(invalid));
}
else
{
@ -1355,7 +1355,7 @@ EncryptionManager::Decrypt::handleInvalidContents()
{
DebugLog(<< "No valid contents in the response" << endl);
InvalidContents* invalid = new InvalidContents(mOriginalMsgContents, mOriginalMsgContentsType);
mMsgToDecrypt->setContents(auto_ptr<Contents>(invalid));
mMsgToDecrypt->setContents(unique_ptr<Contents>(invalid));
}
}

View File

@ -403,7 +403,7 @@ ConnectionBase::preparseNewBytes(int bytesRead)
// .bwc. This handles all appropriate checking for whether
// this is a response or an ACK.
std::auto_ptr<SendData> tryLater(transport()->make503(*mMessage, expectedWait/1000));
std::unique_ptr<SendData> tryLater(transport()->make503(*mMessage, expectedWait/1000));
if(tryLater.get())
{
transport()->send(tryLater);
@ -478,7 +478,7 @@ ConnectionBase::preparseNewBytes(int bytesRead)
// .bwc. This handles all appropriate checking for whether
// this is a response or an ACK.
std::auto_ptr<SendData> tryLater = transport()->make503(*mMessage, expectedWait/1000);
std::unique_ptr<SendData> tryLater = transport()->make503(*mMessage, expectedWait/1000);
if(tryLater.get())
{
transport()->send(tryLater);

View File

@ -116,7 +116,7 @@ unsigned int Helper::hex2integer(const char* _s)
SipMessage*
Helper::makeRequest(const NameAddr& target, const NameAddr& from, const NameAddr& contact, MethodTypes method)
{
std::auto_ptr<SipMessage> request(new SipMessage);
std::unique_ptr<SipMessage> request(new SipMessage);
RequestLine rLine(method);
rLine.uri() = target.uri();
request->header(h_To) = target;
@ -153,7 +153,7 @@ Helper::makeRegister(const NameAddr& to, const NameAddr& from)
SipMessage*
Helper::makeRegister(const NameAddr& to, const NameAddr& from, const NameAddr& contact)
{
std::auto_ptr<SipMessage> request(new SipMessage);
std::unique_ptr<SipMessage> request(new SipMessage);
RequestLine rLine(REGISTER);
rLine.uri().scheme() = to.uri().scheme();
@ -192,7 +192,7 @@ Helper::makeRegister(const NameAddr& to,const Data& transport)
SipMessage*
Helper::makeRegister(const NameAddr& to, const Data& transport, const NameAddr& contact)
{
std::auto_ptr<SipMessage> request(new SipMessage);
std::unique_ptr<SipMessage> request(new SipMessage);
RequestLine rLine(REGISTER);
rLine.uri().scheme() = to.uri().scheme();
@ -231,7 +231,7 @@ Helper::makePublish(const NameAddr& target, const NameAddr& from)
SipMessage*
Helper::makePublish(const NameAddr& target, const NameAddr& from, const NameAddr& contact)
{
std::auto_ptr<SipMessage> request(new SipMessage);
std::unique_ptr<SipMessage> request(new SipMessage);
RequestLine rLine(PUBLISH);
rLine.uri() = target.uri();
@ -261,7 +261,7 @@ Helper::makeMessage(const NameAddr& target, const NameAddr& from)
SipMessage*
Helper::makeMessage(const NameAddr& target, const NameAddr& from, const NameAddr& contact)
{
std::auto_ptr<SipMessage> request(new SipMessage);
std::unique_ptr<SipMessage> request(new SipMessage);
RequestLine rLine(MESSAGE);
rLine.uri() = target.uri();
@ -292,7 +292,7 @@ Helper::makeSubscribe(const NameAddr& target, const NameAddr& from)
SipMessage*
Helper::makeSubscribe(const NameAddr& target, const NameAddr& from, const NameAddr& contact)
{
std::auto_ptr<SipMessage> request(new SipMessage);
std::unique_ptr<SipMessage> request(new SipMessage);
RequestLine rLine(SUBSCRIBE);
rLine.uri() = target.uri();
@ -453,7 +453,7 @@ Helper::makeResponse(const SipMessage& request,
{
// .bwc. Exception safety. Catch/rethrow is dicey because we can't rethrow
// resip::BaseException, since it is abstract.
std::auto_ptr<SipMessage> response(new SipMessage);
std::unique_ptr<SipMessage> response(new SipMessage);
makeResponse(*response, request, responseCode, reason, hostname, warning);
@ -475,7 +475,7 @@ Helper::makeResponse(const SipMessage& request,
{
// .bwc. Exception safety. Catch/rethrow is dicey because we can't rethrow
// resip::BaseException, since it is abstract.
std::auto_ptr<SipMessage> response(new SipMessage);
std::unique_ptr<SipMessage> response(new SipMessage);
makeResponse(*response, request, responseCode, reason, hostname, warning);
return response.release();
@ -574,7 +574,7 @@ Helper::makeCancel(const SipMessage& request)
{
assert(request.isRequest());
assert(request.header(h_RequestLine).getMethod() == INVITE);
std::auto_ptr<SipMessage> cancel(new SipMessage);
std::unique_ptr<SipMessage> cancel(new SipMessage);
RequestLine rLine(CANCEL, request.header(h_RequestLine).getSipVersion());
rLine.uri() = request.header(h_RequestLine).uri();
@ -611,7 +611,7 @@ Helper::makeFailureAck(const SipMessage& request, const SipMessage& response)
assert (request.header(h_Vias).size() >= 1);
assert (request.header(h_RequestLine).getMethod() == INVITE);
std::auto_ptr<SipMessage> ack(new SipMessage);
std::unique_ptr<SipMessage> ack(new SipMessage);
RequestLine rLine(ACK, request.header(h_RequestLine).getSipVersion());
rLine.uri() = request.header(h_RequestLine).uri();
@ -1800,7 +1800,7 @@ Helper::gruuUserPart(const Data& instanceId,
sep.size() + 1
+ aor.size() ) % 8))
% 8));
auto_ptr <unsigned char> out(new unsigned char[token.size()]);
unique_ptr <unsigned char> out(new unsigned char[token.size()]);
BF_cbc_encrypt((const unsigned char*)token.data(),
out.get(),
(long)token.size(),
@ -1840,7 +1840,7 @@ Helper::fromGruuUserPart(const Data& gruuUserPart,
const Data decoded = gruu.base64decode();
auto_ptr <unsigned char> out(new unsigned char[gruuUserPart.size()+1]);
unique_ptr <unsigned char> out(new unsigned char[gruuUserPart.size()+1]);
BF_cbc_encrypt((const unsigned char*)decoded.data(),
out.get(),
(long)decoded.size(),
@ -1864,8 +1864,8 @@ Helper::ContentsSecAttrs::ContentsSecAttrs()
mAttributes(0)
{}
Helper::ContentsSecAttrs::ContentsSecAttrs(std::auto_ptr<Contents> contents,
std::auto_ptr<SecurityAttributes> attributes)
Helper::ContentsSecAttrs::ContentsSecAttrs(std::unique_ptr<Contents> contents,
std::unique_ptr<SecurityAttributes> attributes)
: mContents(contents),
mAttributes(attributes)
{}
@ -1990,8 +1990,8 @@ Helper::extractFromPkcs7(const SipMessage& message,
b = extractFromPkcs7Recurse(b, toAor, fromAor, attr, security);
}
}
std::auto_ptr<Contents> c(b);
std::auto_ptr<SecurityAttributes> a(attr);
std::unique_ptr<Contents> c(b);
std::unique_ptr<SecurityAttributes> a(attr);
return ContentsSecAttrs(c, a);
}
@ -2161,8 +2161,8 @@ SdpContents* getSdpRecurse(Contents* tree)
return 0;
}
static std::auto_ptr<SdpContents> emptysdp;
auto_ptr<SdpContents> Helper::getSdp(Contents* tree)
static std::unique_ptr<SdpContents> emptysdp;
unique_ptr<SdpContents> Helper::getSdp(Contents* tree)
{
if (tree)
{
@ -2171,7 +2171,7 @@ auto_ptr<SdpContents> Helper::getSdp(Contents* tree)
if (sdp)
{
DebugLog(<< "Got sdp" << endl);
return auto_ptr<SdpContents>(static_cast<SdpContents*>(sdp->clone()));
return unique_ptr<SdpContents>(static_cast<SdpContents*>(sdp->clone()));
}
}

View File

@ -162,7 +162,7 @@ InternalTransport::hasDataToSend() const
}
void
InternalTransport::send(std::auto_ptr<SendData> data)
InternalTransport::send(std::unique_ptr<SendData> data)
{
mTxFifo.add(data.release());
}

View File

@ -1837,7 +1837,7 @@ Codec::CodecMap& Codec::getStaticCodecs()
//
// Build map of static codecs as defined in RFC 3551
//
sStaticCodecs = std::auto_ptr<CodecMap>(new CodecMap);
sStaticCodecs = std::unique_ptr<CodecMap>(new CodecMap);
// Audio codecs
sStaticCodecs->insert(make_pair(0,Codec("PCMU",0,8000)));
@ -1907,7 +1907,7 @@ const Codec Codec::FrfDialedDigit("frf-dialed-event",102, 8000);
const Codec Codec::CN("CN", 13, 8000);
bool Codec::sStaticCodecsCreated = false;
std::auto_ptr<Codec::CodecMap> Codec::sStaticCodecs;
std::unique_ptr<Codec::CodecMap> Codec::sStaticCodecs;
/* ====================================================================
* The Vovida Software License, Version 1.0

View File

@ -160,7 +160,7 @@ class SdpContents : public Contents
Data mParameters; // Format parameters
Data mEncodingParameters;
static std::auto_ptr<CodecMap> sStaticCodecs;
static std::unique_ptr<CodecMap> sStaticCodecs;
static bool sStaticCodecsCreated;
friend EncodeStream& operator<<(EncodeStream&, const Codec&);
};

View File

@ -970,7 +970,7 @@ SipMessage::setRawBody(const HeaderFieldValue& body)
void
SipMessage::setContents(auto_ptr<Contents> contents)
SipMessage::setContents(unique_ptr<Contents> contents)
{
Contents* contentsP = contents.release();
@ -1020,11 +1020,11 @@ SipMessage::setContents(const Contents* contents)
{
if (contents)
{
setContents(auto_ptr<Contents>(contents->clone()));
setContents(unique_ptr<Contents>(contents->clone()));
}
else
{
setContents(auto_ptr<Contents>(0));
setContents(unique_ptr<Contents>(0));
}
}
@ -1082,13 +1082,13 @@ SipMessage::getContents() const
return mContents;
}
auto_ptr<Contents>
unique_ptr<Contents>
SipMessage::releaseContents()
{
Contents* c=getContents();
// .bwc. auto_ptr owns the Contents. No other references allowed!
auto_ptr<Contents> ret(c ? c->clone() : 0);
setContents(std::auto_ptr<Contents>(0));
// .bwc. unique_ptr owns the Contents. No other references allowed!
unique_ptr<Contents> ret(c ? c->clone() : 0);
setContents(std::unique_ptr<Contents>(0));
if (ret.get() != 0 && !ret->isWellFormed())
{
@ -1692,7 +1692,7 @@ SipMessage::mergeUri(const Uri& source)
}
void
SipMessage::setSecurityAttributes(auto_ptr<SecurityAttributes> sec)
SipMessage::setSecurityAttributes(unique_ptr<SecurityAttributes> sec)
{
mSecurityAttributes = sec;
}
@ -1746,7 +1746,7 @@ SipMessage::copyOutboundDecoratorsToStackCancel(SipMessage& cancel)
{
if((*i)->copyToStackCancels())
{
cancel.addOutboundDecorator(*(new auto_ptr<MessageDecorator>((*i)->clone())));
cancel.addOutboundDecorator(*(new unique_ptr<MessageDecorator>((*i)->clone())));
}
}
}
@ -1760,7 +1760,7 @@ SipMessage::copyOutboundDecoratorsToStackFailureAck(SipMessage& ack)
{
if((*i)->copyToStackFailureAcks())
{
ack.addOutboundDecorator(*(new auto_ptr<MessageDecorator>((*i)->clone())));
ack.addOutboundDecorator(*(new unique_ptr<MessageDecorator>((*i)->clone())));
}
}
}

View File

@ -461,14 +461,14 @@ class SipMessage : public TransactionMessage
**/
Contents* getContents() const;
/// Removes the contents from the message
std::auto_ptr<Contents> releaseContents();
std::unique_ptr<Contents> releaseContents();
/// @brief Set the contents of the message
/// @param contents to store in the message
void setContents(const Contents* contents);
/// @brief Set the contents of the message
/// @param contents to store in the message
void setContents(std::auto_ptr<Contents> contents);
void setContents(std::unique_ptr<Contents> contents);
/// @internal transport interface
void setStartLine(const char* start, int len);
@ -516,12 +516,12 @@ class SipMessage : public TransactionMessage
SipMessage& mergeUri(const Uri& source);
void setSecurityAttributes(std::auto_ptr<SecurityAttributes>);
void setSecurityAttributes(std::unique_ptr<SecurityAttributes>);
const SecurityAttributes* getSecurityAttributes() const { return mSecurityAttributes.get(); }
/// @brief Call a MessageDecorator to process the message before it is
/// sent to the transport
void addOutboundDecorator(std::auto_ptr<MessageDecorator> md){mOutboundDecorators.push_back(md.release());}
void addOutboundDecorator(std::unique_ptr<MessageDecorator> md){mOutboundDecorators.push_back(md.release());}
void clearOutboundDecorators();
void callOutboundDecorators(const Tuple &src,
const Tuple &dest,
@ -677,7 +677,7 @@ class SipMessage : public TransactionMessage
// peers domain associate with this message (MTLS)
std::list<Data> mTlsPeerNames;
std::auto_ptr<SecurityAttributes> mSecurityAttributes;
std::unique_ptr<SecurityAttributes> mSecurityAttributes;
std::vector<MessageDecorator*> mOutboundDecorators;

View File

@ -389,12 +389,12 @@ SipStack::addTransport( TransportType protocol,
<< ": " << e);
throw;
}
addTransport(std::auto_ptr<Transport>(transport));
addTransport(std::unique_ptr<Transport>(transport));
return transport;
}
void
SipStack::addTransport(std::auto_ptr<Transport> transport)
SipStack::addTransport(std::unique_ptr<Transport> transport)
{
//.dcm. once addTransport starts throwing, need to back out alias
if (!transport->interfaceName().empty())
@ -566,7 +566,7 @@ SipStack::send(const SipMessage& msg, TransactionUser* tu)
}
void
SipStack::send(std::auto_ptr<SipMessage> msg, TransactionUser* tu)
SipStack::send(std::unique_ptr<SipMessage> msg, TransactionUser* tu)
{
DebugLog (<< "SEND: " << msg->brief());
@ -580,7 +580,7 @@ SipStack::send(std::auto_ptr<SipMessage> msg, TransactionUser* tu)
}
void
SipStack::sendTo(std::auto_ptr<SipMessage> msg, const Uri& uri, TransactionUser* tu)
SipStack::sendTo(std::unique_ptr<SipMessage> msg, const Uri& uri, TransactionUser* tu)
{
if (tu) msg->setTransactionUser(tu);
msg->setForceTarget(uri);
@ -590,7 +590,7 @@ SipStack::sendTo(std::auto_ptr<SipMessage> msg, const Uri& uri, TransactionUser*
}
void
SipStack::sendTo(std::auto_ptr<SipMessage> msg, const Tuple& destination, TransactionUser* tu)
SipStack::sendTo(std::unique_ptr<SipMessage> msg, const Tuple& destination, TransactionUser* tu)
{
assert(!mShuttingDown);
@ -641,7 +641,7 @@ SipStack::checkAsyncProcessHandler()
}
void
SipStack::post(std::auto_ptr<ApplicationMessage> message)
SipStack::post(std::unique_ptr<ApplicationMessage> message)
{
assert(!mShuttingDown);
mTuSelector.add(message.release(), TimeLimitFifo<Message>::InternalElement);
@ -678,7 +678,7 @@ SipStack::postMS(const ApplicationMessage& message, unsigned int ms,
}
void
SipStack::post(std::auto_ptr<ApplicationMessage> message,
SipStack::post(std::unique_ptr<ApplicationMessage> message,
unsigned int secondsLater,
TransactionUser* tu)
{
@ -687,7 +687,7 @@ SipStack::post(std::auto_ptr<ApplicationMessage> message,
void
SipStack::postMS( std::auto_ptr<ApplicationMessage> message,
SipStack::postMS( std::unique_ptr<ApplicationMessage> message,
unsigned int ms,
TransactionUser* tu)
{

View File

@ -929,9 +929,9 @@ TransactionState::saveOriginalContactAndVia(const SipMessage& sip)
if(sip.exists(h_Contacts) && sip.const_header(h_Contacts).size() == 1 &&
sip.const_header(h_Contacts).front().isWellFormed())
{
mOriginalContact = std::auto_ptr<NameAddr>(new NameAddr(sip.header(h_Contacts).front()));
mOriginalContact = std::unique_ptr<NameAddr>(new NameAddr(sip.header(h_Contacts).front()));
}
mOriginalVia = std::auto_ptr<Via>(new Via(sip.header(h_Vias).front()));
mOriginalVia = std::unique_ptr<Via>(new Via(sip.header(h_Vias).front()));
}
void TransactionState::restoreOriginalContactAndVia()

View File

@ -224,11 +224,11 @@ Transport::fail(const Data& tid, TransportFailure::FailureReason reason, int sub
}
}
std::auto_ptr<SendData>
std::unique_ptr<SendData>
Transport::makeSendData( const Tuple& dest, const Data& d, const Data& tid, const Data &sigcompId)
{
assert(dest.getPort() != -1);
std::auto_ptr<SendData> data(new SendData(dest, d, tid, sigcompId));
std::unique_ptr<SendData> data(new SendData(dest, d, tid, sigcompId));
return data;
}
@ -241,7 +241,7 @@ Transport::makeFailedResponse(const SipMessage& msg,
const Tuple& dest = msg.getSource();
std::auto_ptr<SipMessage> errMsg(Helper::makeResponse(msg,
std::unique_ptr<SipMessage> errMsg(Helper::makeResponse(msg,
responseCode,
warning ? warning : "Original request had no Vias"));
@ -259,13 +259,13 @@ Transport::makeFailedResponse(const SipMessage& msg,
// Calculate compartment ID for outbound message
Data remoteSigcompId;
setRemoteSigcompId(*errMsg,remoteSigcompId);
send(std::auto_ptr<SendData>(makeSendData(dest, encoded, Data::Empty, remoteSigcompId)));
send(std::unique_ptr<SendData>(makeSendData(dest, encoded, Data::Empty, remoteSigcompId)));
}
std::auto_ptr<SendData>
std::unique_ptr<SendData>
Transport::make503(SipMessage& msg, UInt16 retryAfter)
{
std::auto_ptr<SendData> result;
std::unique_ptr<SendData> result;
if (msg.isResponse()) return result;
try
@ -296,10 +296,10 @@ Transport::make503(SipMessage& msg, UInt16 retryAfter)
return result;
}
std::auto_ptr<SendData>
std::unique_ptr<SendData>
Transport::make100(SipMessage& msg)
{
std::auto_ptr<SendData> result;
std::unique_ptr<SendData> result;
if (msg.isResponse()) return result;
try

View File

@ -162,7 +162,7 @@ TransportSelector::isFinished() const
}
void
TransportSelector::addTransport(std::auto_ptr<Transport> autoTransport,
TransportSelector::addTransport(std::unique_ptr<Transport> autoTransport,
bool immediate)
{
if(immediate)
@ -176,7 +176,7 @@ TransportSelector::addTransport(std::auto_ptr<Transport> autoTransport,
}
void
TransportSelector::addTransportInternal(std::auto_ptr<Transport> autoTransport)
TransportSelector::addTransportInternal(std::unique_ptr<Transport> autoTransport)
{
Transport* transport = autoTransport.release();
mDns.addTransportType(transport->transport(), transport->ipVersion());
@ -370,7 +370,7 @@ TransportSelector::process()
void
TransportSelector::checkTransportAddQueue()
{
std::auto_ptr<Transport> t(mTransportsToAdd.getNext(-1));
std::unique_ptr<Transport> t(mTransportsToAdd.getNext(-1));
while(t.get())
{
addTransportInternal(t);
@ -1138,7 +1138,7 @@ TransportSelector::transmit(SipMessage* msg, Tuple& target, SendData* sendData)
// Call back anyone who wants to perform outbound decoration
msg->callOutboundDecorators(source, target,remoteSigcompId);
std::auto_ptr<SendData> send(new SendData(target,
std::unique_ptr<SendData> send(new SendData(target,
resip::Data::Empty,
msg->getTransactionId(),
remoteSigcompId));
@ -1217,7 +1217,7 @@ TransportSelector::retransmit(const SendData& data)
if(transport)
{
// If this is not true, it means the transport has been removed.
transport->send(std::auto_ptr<SendData>(data.clone()));
transport->send(std::unique_ptr<SendData>(data.clone()));
}
}
@ -1232,7 +1232,7 @@ TransportSelector::closeConnection(const Tuple& peer)
resip::Data::Empty,
resip::Data::Empty);
close->command = SendData::CloseConnection;
t->send(std::auto_ptr<SendData>(close));
t->send(std::unique_ptr<SendData>(close));
}
}
@ -1279,7 +1279,7 @@ TransportSelector::enableFlowTimer(const resip::Tuple& flow)
resip::Data::Empty,
resip::Data::Empty);
enableFlowTimer->command = SendData::EnableFlowTimer;
t->send(std::auto_ptr<SendData>(enableFlowTimer));
t->send(std::unique_ptr<SendData>(enableFlowTimer));
}
}

View File

@ -143,7 +143,7 @@ TuIM::sendPage(const Data& text, const Uri& dest,
DeprecatedDialog* dialog = new DeprecatedDialog( NameAddr(mContact) );
auto_ptr<SipMessage> msg( dialog->makeInitialMessage(NameAddr(target),NameAddr(from)) );
unique_ptr<SipMessage> msg( dialog->makeInitialMessage(NameAddr(target),NameAddr(from)) );
Page page;
page.text = text;
@ -411,7 +411,7 @@ TuIM::processSubscribeRequest(SipMessage* msg)
assert( dialog );
dialog->setExpirySeconds( expires );
auto_ptr<SipMessage> response( dialog->makeResponse( *msg, 200 ));
unique_ptr<SipMessage> response( dialog->makeResponse( *msg, 200 ));
response->header(h_Expires).value() = expires;
response->header(h_Event).value() = Data("presence");
@ -504,7 +504,7 @@ TuIM::processNotifyRequest(SipMessage* msg)
processSipFrag( msg );
auto_ptr<SipMessage> response( Helper::makeResponse( *msg, 200 ));
unique_ptr<SipMessage> response( Helper::makeResponse( *msg, 200 ));
mStack->send( *response );
Uri from = msg->header(h_From).uri();
@ -1110,7 +1110,7 @@ TuIM::process()
{
if ( mRegistrationDialog.isCreated() )
{
auto_ptr<SipMessage> msg( mRegistrationDialog.makeRegister() );
unique_ptr<SipMessage> msg( mRegistrationDialog.makeRegister() );
msg->header(h_Expires).value() = mRegistrationTimeSeconds;
setOutbound( *msg );
mStack->send( *msg );
@ -1131,7 +1131,7 @@ TuIM::process()
assert( buddy.presDialog );
if ( buddy.presDialog->isCreated() )
{
auto_ptr<SipMessage> msg( buddy.presDialog->makeSubscribe() );
unique_ptr<SipMessage> msg( buddy.presDialog->makeSubscribe() );
msg->header(h_Event).value() = Data("presence");;
msg->header(h_Accepts).push_back( Mime( "application","pidf+xml") );
@ -1183,7 +1183,7 @@ TuIM::registerAor( const Uri& uri, const Data& password )
//contactName.uri() = mContact;
//SipMessage* msg = Helper::makeRegister(aorName,aorName,contactName);
auto_ptr<SipMessage> msg( mRegistrationDialog.makeInitialRegister(NameAddr(uri),NameAddr(uri)) );
unique_ptr<SipMessage> msg( mRegistrationDialog.makeInitialRegister(NameAddr(uri),NameAddr(uri)) );
msg->header(h_Expires).value() = mRegistrationTimeSeconds;
msg->header(h_Contacts).front().param(p_expires) = mRegistrationTimeSeconds;
@ -1248,7 +1248,7 @@ void
TuIM::subscribeBuddy( Buddy& buddy )
{
// subscribe to this budy
auto_ptr<SipMessage> msg( buddy.presDialog->makeInitialSubscribe(NameAddr(buddy.uri),NameAddr(mAor)) );
unique_ptr<SipMessage> msg( buddy.presDialog->makeInitialSubscribe(NameAddr(buddy.uri),NameAddr(mAor)) );
msg->header(h_Event).value() = Data("presence");;
msg->header(h_Accepts).push_back( Mime( "application","pidf+xml") );
@ -1308,7 +1308,7 @@ TuIM::sendNotify(DeprecatedDialog* dialog)
{
assert( dialog );
auto_ptr<SipMessage> msg( dialog->makeNotify() );
unique_ptr<SipMessage> msg( dialog->makeNotify() );
Pidf* pidf = new Pidf( *mPidf );
@ -1332,7 +1332,7 @@ TuIM::sendPublish(StateAgent& sa)
{
assert( sa.dialog );
auto_ptr<SipMessage> msg( sa.dialog->makeInitialPublish(NameAddr(sa.uri),NameAddr(mAor)) );
unique_ptr<SipMessage> msg( sa.dialog->makeInitialPublish(NameAddr(sa.uri),NameAddr(mAor)) );
Pidf* pidf = new Pidf( *mPidf );

View File

@ -237,7 +237,7 @@ UdpTransport::processTxOne(SendData *data)
{
++mTxMsgCnt;
assert(data);
std::auto_ptr<SendData> sendData(data);
std::unique_ptr<SendData> sendData(data);
//DebugLog (<< "Sent: " << sendData->data);
//DebugLog (<< "Sending message on udp.");
assert( sendData->destination.getPort() != 0 );
@ -598,7 +598,7 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender)
StackLog(<< Data(Data::Borrow, buffer, len));
if(mExternalUnknownDatagramHandler)
{
auto_ptr<Data> datagram(new Data(buffer,len));
unique_ptr<Data> datagram(new Data(buffer,len));
(*mExternalUnknownDatagramHandler)(this,sender,datagram);
}
@ -640,7 +640,7 @@ UdpTransport::processRxParse(char *buffer, int len, Tuple& sender)
// .bwc. This handles all appropriate checking for whether
// this is a response or an ACK.
std::auto_ptr<SendData> tryLater(make503(*message, getExpectedWaitForIncoming()/1000));
std::unique_ptr<SendData> tryLater(make503(*message, getExpectedWaitForIncoming()/1000));
if(tryLater.get())
{
send(tryLater);

View File

@ -264,8 +264,8 @@ class Uri : public ParserCategory
mutable bool mHostCanonicalized;
private:
std::auto_ptr<Data> mEmbeddedHeadersText;
std::auto_ptr<SipMessage> mEmbeddedHeaders;
std::unique_ptr<Data> mEmbeddedHeadersText;
std::unique_ptr<SipMessage> mEmbeddedHeaders;
static ParameterTypes::Factory ParameterFactories[ParameterTypes::MAX_PARAMETER];

View File

@ -1857,7 +1857,7 @@ BaseSecurity::checkIdentity( const Data& signerDomain, const Data& in, const Dat
void
BaseSecurity::checkAndSetIdentity(SipMessage& msg, const Data& certDer) const
{
auto_ptr<SecurityAttributes> sec(new SecurityAttributes);
unique_ptr<SecurityAttributes> sec(new SecurityAttributes);
X509* cert=NULL;
try