[asterisk-scf-commits] asterisk-scf/release/bridging.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Tue Apr 19 08:26:20 CDT 2011
branch "master" has been updated
via 99fbea34400b3eedcbee29014104cf60b332555a (commit)
from bae047c389685f743ff52036ee82429913bfe775 (commit)
Summary of changes:
src/BridgeImpl.cpp | 6 ++--
src/BridgeImpl.h | 2 +-
src/BridgeManagerImpl.cpp | 2 +-
src/BridgeManagerImpl.h | 2 +-
src/BridgeReplicatorStateListenerI.cpp | 8 ++--
src/MediaSplicer.cpp | 53 ++++++++++++++--------------
src/SessionWrapper.cpp | 60 ++++++++++++++++----------------
src/Tasks.h | 4 +-
test/TestBridging.cpp | 10 +++---
9 files changed, 74 insertions(+), 73 deletions(-)
- Log -----------------------------------------------------------------
commit 99fbea34400b3eedcbee29014104cf60b332555a
Author: Brent Eagles <beagles at digium.com>
Date: Tue Apr 19 10:56:02 2011 -0230
Address shadow warnings in recent commits.
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 890d0b3..986aa73 100755
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -106,7 +106,7 @@ public:
void activate();
string id();
- SessionCollectionPtr sessions();
+ SessionCollectionPtr getSessions();
void forceUpdate();
@@ -400,7 +400,7 @@ public:
protected:
bool executeImpl()
{
- if (mBridge->sessions()->size() < 2 && mPrx)
+ if (mBridge->getSessions()->size() < 2 && mPrx)
{
mPrx->begin_shutdown(newCallback_Bridge_shutdown(this, &CheckShutdown::done,
&CheckShutdown::failed));
@@ -908,7 +908,7 @@ string BridgeImpl::id()
return mState->bridgeId;
}
-SessionCollectionPtr BridgeImpl::sessions()
+SessionCollectionPtr BridgeImpl::getSessions()
{
return mSessions;
}
diff --git a/src/BridgeImpl.h b/src/BridgeImpl.h
index 118686a..f764355 100644
--- a/src/BridgeImpl.h
+++ b/src/BridgeImpl.h
@@ -105,7 +105,7 @@ public:
virtual std::string id() = 0;
- virtual SessionCollectionPtr sessions() = 0;
+ virtual SessionCollectionPtr getSessions() = 0;
/**
*
diff --git a/src/BridgeManagerImpl.cpp b/src/BridgeManagerImpl.cpp
index 4ce7a1b..be58b67 100644
--- a/src/BridgeManagerImpl.cpp
+++ b/src/BridgeManagerImpl.cpp
@@ -79,7 +79,7 @@ public:
void activate();
- string id()
+ string getID()
{
return mName;
}
diff --git a/src/BridgeManagerImpl.h b/src/BridgeManagerImpl.h
index f9f2c71..dd7fad3 100644
--- a/src/BridgeManagerImpl.h
+++ b/src/BridgeManagerImpl.h
@@ -50,7 +50,7 @@ public:
virtual void activate() = 0;
- virtual std::string id() = 0;
+ virtual std::string getID() = 0;
virtual void createBridgeReplica(const AsteriskSCF::Bridge::V1::BridgeStateItemPtr& bridgeState) = 0;
diff --git a/src/BridgeReplicatorStateListenerI.cpp b/src/BridgeReplicatorStateListenerI.cpp
index 0f47d91..5186463 100644
--- a/src/BridgeReplicatorStateListenerI.cpp
+++ b/src/BridgeReplicatorStateListenerI.cpp
@@ -62,7 +62,7 @@ public:
{
if ((*b) && (*b)->id() == bridgedSessionItem->bridgeId)
{
- SessionCollectionPtr sessions = (*b)->sessions();
+ SessionCollectionPtr sessions = (*b)->getSessions();
sessions->removeSession(bridgedSessionItem);
//
// Keep the session list clean.
@@ -147,7 +147,7 @@ public:
BridgeManagerStateItemPtr managerItem = BridgeManagerStateItemPtr::dynamicCast((*i));
if (managerItem)
{
- if(managerItem->key == mManager->id())
+ if(managerItem->key == mManager->getID())
{
//
// There is only on bridge per listener instance by design/implementation, so this
@@ -198,7 +198,7 @@ public:
{
if ((*b) && (*b)->id() == bridgedSessionItem->bridgeId)
{
- SessionCollectionPtr sessions = (*b)->sessions();
+ SessionCollectionPtr sessions = (*b)->getSessions();
sessions->replicaUpdate(bridgedSessionItem);
//
// Keep the session list clean.
@@ -226,7 +226,7 @@ public:
{
if ((*b) && (*b)->id() == sessionPairing->bridgeKey)
{
- SessionWrapperPtr session = (*b)->sessions()->getSession(sessionPairing->sessionKey);
+ SessionWrapperPtr session = (*b)->getSessions()->getSession(sessionPairing->sessionKey);
if (session)
{
session->updateMedia(sessionPairing);
diff --git a/src/MediaSplicer.cpp b/src/MediaSplicer.cpp
index b0dd7f1..233df9e 100755
--- a/src/MediaSplicer.cpp
+++ b/src/MediaSplicer.cpp
@@ -190,48 +190,48 @@ public:
const IncomingPairings& incoming)
{
mLogger(Debug) << FUNLOG << ": establishing a new peer connection.";
- SessionPairingPtr update;
+ SessionPairingPtr currentState;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
mPeer = peer;
mOutgoing = outgoing;
mIncoming = incoming;
- update = createUpdate();
+ currentState = createUpdate();
}
- pushUpdate(update);
+ pushUpdate(currentState);
}
SessionPairingPtr createUpdate()
{
if (mReplicator)
{
- SessionPairingPtr update(new SessionPairing);
- update->mediaSession = mMedia;
- update->bridgeKey = mBridgeId;
- update->sessionKey = mSessionId;
- update->key = mKey;
- update->serial = ++mRepCounter;
+ SessionPairingPtr currentState(new SessionPairing);
+ currentState->mediaSession = mMedia;
+ currentState->bridgeKey = mBridgeId;
+ currentState->sessionKey = mSessionId;
+ currentState->key = mKey;
+ currentState->serial = ++mRepCounter;
for (vector<OutgoingPairing>::iterator i = mOutgoing.begin(); i != mOutgoing.end(); ++i)
{
- update->outgoingMediaPairings.push_back(new MediaPairing(i->second, i->first));
+ currentState->outgoingMediaPairings.push_back(new MediaPairing(i->second, i->first));
}
for (vector<IncomingPairing>::iterator i = mIncoming.begin(); i != mIncoming.end(); ++i)
{
- update->incomingMediaPairings.push_back(new MediaPairing(i->first, i->second));
+ currentState->incomingMediaPairings.push_back(new MediaPairing(i->first, i->second));
}
- return update;
+ return currentState;
}
return 0;
}
- void pushUpdate(const SessionPairingPtr& update)
+ void pushUpdate(const SessionPairingPtr& newState)
{
- if (mReplicator && update)
+ if (mReplicator && newState)
{
try
{
ReplicatedStateItemSeq seq;
- seq.push_back(update);
+ seq.push_back(newState);
mReplicator->setState(seq);
}
catch (const std::exception& ex)
@@ -253,7 +253,7 @@ public:
{
vector<OutgoingPairing> outgoing;
vector<IncomingPairing> incoming;
- SessionPairingPtr update;
+ SessionPairingPtr newState;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
outgoing = mOutgoing;
@@ -261,9 +261,9 @@ public:
incoming = mIncoming;
mIncoming.clear();
mConnected = false;
- update = createUpdate();
+ newState = createUpdate();
}
- pushUpdate(update);
+ pushUpdate(newState);
if (outgoing.size() == 0 && incoming.size() == 0)
{
return;
@@ -277,7 +277,8 @@ public:
//
for (vector<OutgoingPairing>::iterator i = outgoing.begin(); i != outgoing.end(); ++i)
{
- mLogger(Debug) << FUNLOG << ": disconnecting " << i->second->ice_toString() << " and " << i->first->ice_toString();
+ mLogger(Debug) << FUNLOG << ": disconnecting " << i->second->ice_toString() << " and "
+ << i->first->ice_toString();
try
{
@@ -318,17 +319,17 @@ public:
}
}
- void update(const SessionPairingPtr& update)
+ void update(const SessionPairingPtr& newState)
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
- mRepCounter = update->serial;
+ mRepCounter = newState->serial;
mOutgoing.clear();
mIncoming.clear();
- for (MediaPairingSeq::iterator i = update->outgoingMediaPairings.begin(); i != update->outgoingMediaPairings.end(); ++i)
+ for (MediaPairingSeq::iterator i = newState->outgoingMediaPairings.begin(); i != newState->outgoingMediaPairings.end(); ++i)
{
mOutgoing.push_back(OutgoingPairing((*i)->sink, (*i)->source));
}
- for (MediaPairingSeq::iterator i = update->incomingMediaPairings.begin(); i != update->incomingMediaPairings.end(); ++i)
+ for (MediaPairingSeq::iterator i = newState->incomingMediaPairings.begin(); i != newState->incomingMediaPairings.end(); ++i)
{
mIncoming.push_back(IncomingPairing((*i)->source, (*i)->sink));
}
@@ -339,7 +340,7 @@ public:
mLogger(Debug) << FUNLOG << ": unplugging sinks and sources.";
vector<OutgoingPairing> outgoing;
vector<IncomingPairing> incoming;
- SessionPairingPtr update;
+ SessionPairingPtr newState;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
outgoing = mOutgoing;
@@ -347,9 +348,9 @@ public:
incoming = mIncoming;
mIncoming.clear();
mConnected = false;
- update = createUpdate();
+ newState = createUpdate();
}
- pushUpdate(update);
+ pushUpdate(newState);
if (outgoing.size() == 0 && incoming.size() == 0)
{
return false;
diff --git a/src/SessionWrapper.cpp b/src/SessionWrapper.cpp
index 336ab16..a13dd18 100644
--- a/src/SessionWrapper.cpp
+++ b/src/SessionWrapper.cpp
@@ -64,29 +64,29 @@ public:
{
ex.ice_throw();
}
- catch (const Ice::RequestFailedException& ex)
+ catch (const Ice::RequestFailedException& x)
{
//
// These exceptions indicate something is wrong with the request on this object. We should not expect that
// it could ever exceed. ObjectNotExistException is included in this catch.
// TODO- it might be reasonable to disconnect this session for this!
//
- mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << ex.what();
+ mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << x.what();
mSession->destroy();
}
- catch (const Ice::SocketException& ex)
+ catch (const Ice::SocketException& x)
{
//
// A possible retry scenario.
//
- mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << ex.what();
+ mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << x.what();
}
- catch (const std::exception& ex)
+ catch (const std::exception& x)
{
//
// Not much to be done here except log the error and move on.
//
- mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << ex.what();
+ mLogger(Warning) << "exception when calling connect() on " << mSession->id() << ": " << x.what();
}
}
@@ -365,17 +365,17 @@ void SessionWrapper::ring()
bool SessionWrapper::setConnected()
{
mLogger(Debug) << FUNLOG << " for " << mId;
- BridgedSessionPtr update;
+ BridgedSessionPtr stateUpdate;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
if (mSession->currentState == Added)
{
mSession->currentState = Connected;
- update = createUpdate();
+ stateUpdate = createUpdate();
}
}
- pushUpdate(update);
- return (update != 0);
+ pushUpdate(stateUpdate);
+ return (stateUpdate != 0);
}
BridgedSessionPtr SessionWrapper::getBridgedSession() const
@@ -393,17 +393,17 @@ SessionPrx SessionWrapper::getSession() const
void SessionWrapper::setupMedia()
{
mLogger(Debug) << FUNLOG << " for " << mId;
- BridgedSessionPtr update;
+ BridgedSessionPtr stateUpdate;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
if (mSession->currentState == Added)
{
mSplicer->connect(this);
mSession->currentState = Connected;
- update = createUpdate();
+ stateUpdate = createUpdate();
}
}
- pushUpdate(update);
+ pushUpdate(stateUpdate);
}
void SessionWrapper::setConnector(const MediaConnectorPtr& connector)
@@ -432,7 +432,7 @@ void SessionWrapper::updateMedia(const SessionPairingPtr& pairings)
void SessionWrapper::disconnect()
{
mLogger(Debug) << FUNLOG << ": disconnecting " << mId;
- BridgedSessionPtr update;
+ BridgedSessionPtr stateUpdate;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
if (mSession->currentState != Disconnected &&
@@ -440,31 +440,31 @@ void SessionWrapper::disconnect()
{
unplugMedia();
mSession->currentState = Disconnected;
- update = createUpdate();
+ stateUpdate = createUpdate();
}
}
- pushUpdate(update);
+ pushUpdate(stateUpdate);
}
-void SessionWrapper::update(const BridgedSessionPtr& update)
+void SessionWrapper::update(const BridgedSessionPtr& newState)
{
mLogger(Debug) << FUNLOG << ": for " << mId;
boost::unique_lock<boost::shared_mutex> lock(mLock);
- if (mSession->serial < update->serial || update->serial < SerialCounterStart)
+ if (mSession->serial < newState->serial || newState->serial < SerialCounterStart)
{
- mSession = update;
+ mSession = newState;
}
else
{
- mLogger(Info) << ": detected out of order replication update for " << update->key <<
- "(" << mSession->serial << " to " << update->serial << ")";
+ mLogger(Info) << ": detected out of order replication update for " << newState->key <<
+ "(" << mSession->serial << " to " << newState->serial << ")";
}
}
void SessionWrapper::destroy()
{
mLogger(Debug) << FUNLOG << ": for " << mId;
- BridgedSessionPtr update;
+ BridgedSessionPtr newState;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
if (mSession->currentState != Done)
@@ -475,10 +475,10 @@ void SessionWrapper::destroy()
//
unplugMedia();
mSession->currentState = Done;
- update = createUpdate();
+ newState = createUpdate();
}
}
- pushUpdate(update);
+ pushUpdate(newState);
}
bool SessionWrapper::isDestroyed()
@@ -515,16 +515,16 @@ void SessionWrapper::shutdown(const SessionListenerPrx& listener, const Response
void SessionWrapper::setState(const AsteriskSCF::Bridge::V1::BridgedSessionState newState)
{
mLogger(Debug) << FUNLOG << ": updating state " << mId;
- BridgedSessionPtr update;
+ BridgedSessionPtr copyOfNewState;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
//
// TODO:
//
mSession->currentState = newState;
- update = createUpdate();
+ copyOfNewState = createUpdate();
}
- pushUpdate(update);
+ pushUpdate(copyOfNewState);
}
void SessionWrapper::unplugMedia()
@@ -542,12 +542,12 @@ void SessionWrapper::unplugMedia()
}
}
-void SessionWrapper::pushUpdate(const BridgedSessionPtr& update)
+void SessionWrapper::pushUpdate(const BridgedSessionPtr& newState)
{
- if (update && mReplicator)
+ if (newState && mReplicator)
{
ReplicatedStateItemSeq seq;
- seq.push_back(update);
+ seq.push_back(newState);
mReplicator->setState(seq);
}
}
diff --git a/src/Tasks.h b/src/Tasks.h
index bfaa6d5..57898b3 100644
--- a/src/Tasks.h
+++ b/src/Tasks.h
@@ -163,8 +163,8 @@ protected:
{
}
- QueuedTask(const std::string& name) :
- mName(name)
+ QueuedTask(const std::string& nameStr) :
+ mName(nameStr)
{
}
diff --git a/test/TestBridging.cpp b/test/TestBridging.cpp
index b43506a..41ee52c 100644
--- a/test/TestBridging.cpp
+++ b/test/TestBridging.cpp
@@ -73,10 +73,10 @@ public:
// usage is a little more expensive in that you are always setting whether it's set or not, but it
// avoids having the "if" statement.
//
- Ice::PropertiesPtr properties = mCommunicator->getProperties();
- propGetSet(properties, "TestUtilAdapter.ThreadPool.Size", "4");
- propGetSet(properties, "TestUtilAdapter.ThreadPool.Size", "4");
- propGetSet(properties, "TestUtilAdapter.Endpoints", "default");
+ Ice::PropertiesPtr props = mCommunicator->getProperties();
+ propGetSet(props, "TestUtilAdapter.ThreadPool.Size", "4");
+ propGetSet(props, "TestUtilAdapter.ThreadPool.Size", "4");
+ propGetSet(props, "TestUtilAdapter.Endpoints", "default");
lookupProxies();
}
@@ -247,7 +247,7 @@ public:
}
}
- AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx locator()
+ AsteriskSCF::Core::Routing::V1::EndpointLocatorPrx getLocator()
{
return mLocatorPrx;
}
-----------------------------------------------------------------------
--
asterisk-scf/release/bridging.git
More information about the asterisk-scf-commits
mailing list