[asterisk-scf-commits] asterisk-scf/integration/bridging.git branch "async-bridging" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Mon Mar 14 13:51:04 CDT 2011
branch "async-bridging" has been updated
via a911c2e9da43c5b8ff6e54da7d91e452765a0c3a (commit)
from d0f7834cd6374340365048b2d838da1bad18b026 (commit)
Summary of changes:
src/BridgeImpl.cpp | 8 ++--
src/ServiceUtil.h | 2 +-
src/SessionCollection.cpp | 10 ++--
src/SessionWrapper.cpp | 28 ++++++------
test/UnitTests.cpp | 100 ++++++++++++++++++++++----------------------
5 files changed, 74 insertions(+), 74 deletions(-)
- Log -----------------------------------------------------------------
commit a911c2e9da43c5b8ff6e54da7d91e452765a0c3a
Author: Brent Eagles <beagles at digium.com>
Date: Mon Mar 14 16:20:23 2011 -0230
Fix warnings and errors on Windows build.
diff --git a/src/BridgeImpl.cpp b/src/BridgeImpl.cpp
index 19ccb4f..d29fb29 100644
--- a/src/BridgeImpl.cpp
+++ b/src/BridgeImpl.cpp
@@ -292,7 +292,7 @@ void BridgeImpl::addSessions(const SessionSeq& sessions)
}
}
}
- catch (const Ice::Exception& ex)
+ catch (const Ice::Exception&)
{
}
}
@@ -617,8 +617,8 @@ void BridgeImpl::replaceSession_async(const AMD_Bridge_replaceSessionPtr& callba
bool BridgeImpl::destroyed()
{
boost::shared_lock<boost::shared_mutex> lock(mLock);
- mLogger(Debug) << FUNLOG << ": " << (mState == Destroyed ? "yes, I am destroyed." : "no, I am not destroyed") ;
- return mState->runningState == Destroyed;
+ mLogger(Debug) << FUNLOG << ": " << (mState->runningState == Destroyed ? "yes, I am destroyed." : "no, I am not destroyed") ;
+ return (mState->runningState == Destroyed);
}
void BridgeImpl::destroyImpl()
@@ -836,7 +836,7 @@ AsteriskSCF::BridgeService::BridgeServant::create(const string& name, const Ice:
// In the future it may be possible for the bridge replica to reconstruct its media operations
// allowing localized resources to be used.
//
- state->mediaReplicationPolicy = MediaOperationReplicationPolicy::Replicate;
+ state->mediaReplicationPolicy = Replicate;
return new BridgeImpl(name, objectAdapter, listeners, listenerMgr, replicator, state, logger);
}
diff --git a/src/ServiceUtil.h b/src/ServiceUtil.h
index f2b4917..206fb9f 100644
--- a/src/ServiceUtil.h
+++ b/src/ServiceUtil.h
@@ -181,7 +181,7 @@ PrxType tryOneWay(const PrxType& orig)
{
return PrxType::uncheckedCast(orig->ice_oneway());
}
- catch (const Ice::NoEndpointException& ex)
+ catch (const Ice::NoEndpointException&)
{
}
return orig;
diff --git a/src/SessionCollection.cpp b/src/SessionCollection.cpp
index e59e6e6..876a53a 100644
--- a/src/SessionCollection.cpp
+++ b/src/SessionCollection.cpp
@@ -86,7 +86,7 @@ SessionWrapperPtr SessionCollection::addSession(const SessionPrx& session)
bridgedSession->key = key;
bridgedSession->serial = SerialCounterStart;
bridgedSession->session = session;
- bridgedSession->currentState = BridgedSessionState::Added;
+ bridgedSession->currentState = Added;
bridgedSession->sessionPairingKey = "";
bridgedSession->bridgeId = mBridgeId;
bridgedSession->orderAdded = mSessionCounter;
@@ -120,8 +120,8 @@ SessionSeq SessionCollection::getSessionSeq()
// TODO: Look at creating some private preinitialized criteria sets so we don't have to initialize this each time.
//
set<BridgedSessionState> states;
- states.insert(BridgedSessionState::Added);
- states.insert(BridgedSessionState::Connected);
+ states.insert(Added);
+ states.insert(Connected);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> active(states);
SelectOperation< IfInCriteria<set<BridgedSessionState>, StateMemberSelector>, SessionPrxSelector, SessionSeq>
@@ -141,8 +141,8 @@ size_t SessionCollection::size()
void SessionCollection::reap()
{
set<BridgedSessionState> states;
- states.insert(BridgedSessionState::Disconnected);
- states.insert(BridgedSessionState::Done);
+ states.insert(Disconnected);
+ states.insert(Done);
//
// Pick out all of the sessions that should be reaped and remove them from the map.
diff --git a/src/SessionWrapper.cpp b/src/SessionWrapper.cpp
index 39cfbdc..d7b4271 100644
--- a/src/SessionWrapper.cpp
+++ b/src/SessionWrapper.cpp
@@ -281,7 +281,7 @@ QueuedTasks createShutdownTasks(const SessionWrapperPtr& session, const SessionL
// Tasks are a queued, so they go in order that they will be processed.
//
QueuedTasks tasks;
- tasks.push_back(new SetStateTask(session, BridgedSessionState::Disconnected));
+ tasks.push_back(new SetStateTask(session, Disconnected));
tasks.push_back(new RemoveBridgeTask(session, listener));
tasks.push_back(new SessionStopTask(session, code));
//
@@ -294,7 +294,7 @@ QueuedTasks createShutdownTasks(const SessionWrapperPtr& session, const SessionL
QueuedTasks createSetupTasks(const SessionWrapperPtr& session)
{
QueuedTasks tasks;
- tasks.push_back(new SetStateTask(session, BridgedSessionState::Connected));
+ tasks.push_back(new SetStateTask(session, Connected));
tasks.push_back(new ConnectMediaTask(session));
return tasks;
}
@@ -316,7 +316,7 @@ SessionWrapper::SessionWrapper(const BridgedSessionPtr& session,
bool SessionWrapper::isConnected()
{
boost::shared_lock<boost::shared_mutex> lock(mLock);
- return mSession->currentState == BridgedSessionState::Connected;
+ return mSession->currentState == Connected;
}
void SessionWrapper::connect()
@@ -341,7 +341,7 @@ void SessionWrapper::ring()
{
{
boost::shared_lock<boost::shared_mutex> lock(mLock);
- if (mSession->currentState != BridgedSessionState::Added)
+ if (mSession->currentState != Added)
{
return;
}
@@ -355,9 +355,9 @@ bool SessionWrapper::setConnected()
BridgedSessionPtr update;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
- if (mSession->currentState == BridgedSessionState::Added)
+ if (mSession->currentState == Added)
{
- mSession->currentState = BridgedSessionState::Connected;
+ mSession->currentState = Connected;
update = createUpdate();
}
}
@@ -383,10 +383,10 @@ void SessionWrapper::setupMedia()
BridgedSessionPtr update;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
- if (mSession->currentState == BridgedSessionState::Added)
+ if (mSession->currentState == Added)
{
mSplicer->connect(this);
- mSession->currentState = BridgedSessionState::Connected;
+ mSession->currentState = Connected;
update = createUpdate();
}
}
@@ -422,11 +422,11 @@ void SessionWrapper::disconnect()
BridgedSessionPtr update;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
- if (mSession->currentState != BridgedSessionState::Disconnected &&
- mSession->currentState != BridgedSessionState::Done)
+ if (mSession->currentState != Disconnected &&
+ mSession->currentState != Done)
{
unplugMedia();
- mSession->currentState = BridgedSessionState::Disconnected;
+ mSession->currentState = Disconnected;
update = createUpdate();
}
}
@@ -454,14 +454,14 @@ void SessionWrapper::destroy()
BridgedSessionPtr update;
{
boost::unique_lock<boost::shared_mutex> lock(mLock);
- if (mSession->currentState != BridgedSessionState::Done)
+ if (mSession->currentState != Done)
{
//
// TODO: This should be a best effort attempt to unplug the media. This might mean some
// oneways along with some exception wherever the disconnections are actually taking place.
//
unplugMedia();
- mSession->currentState = BridgedSessionState::Done;
+ mSession->currentState = Done;
update = createUpdate();
}
}
@@ -471,7 +471,7 @@ void SessionWrapper::destroy()
bool SessionWrapper::isDestroyed()
{
boost::shared_lock<boost::shared_mutex> lock(mLock);
- return mSession->currentState == BridgedSessionState::Done;
+ return mSession->currentState == Done;
}
string SessionWrapper::id()
diff --git a/test/UnitTests.cpp b/test/UnitTests.cpp
index d14012a..b9e01b3 100644
--- a/test/UnitTests.cpp
+++ b/test/UnitTests.cpp
@@ -143,24 +143,24 @@ private:
BOOST_FIXTURE_TEST_CASE(testIfState, Fixture)
{
- BridgedSessionPtr letter(createBridgedSession(BridgedSessionState::Added));
+ BridgedSessionPtr letter(createBridgedSession(Added));
SessionWrapperPtr wrapper(new SessionWrapper(letter, 0, AsteriskSCF::BridgeService::ReplicatorSmartPrx(), getLogger()));
- IfStateCriteria a(BridgedSessionState::Added);
- IfStateCriteria b(BridgedSessionState::Connected);
+ IfStateCriteria a(Added);
+ IfStateCriteria b(Connected);
BOOST_CHECK(a(wrapper));
BOOST_CHECK(!b(wrapper));
}
BOOST_FIXTURE_TEST_CASE(testIfInCrriteria, Fixture)
{
- BridgedSessionPtr letter(createBridgedSession(BridgedSessionState::Added));
+ BridgedSessionPtr letter(createBridgedSession(Added));
SessionWrapperPtr wrapper(new SessionWrapper(letter, 0, AsteriskSCF::BridgeService::ReplicatorSmartPrx(), getLogger()));
set<BridgedSessionState> yesVals;
- yesVals.insert(BridgedSessionState::Added);
- yesVals.insert(BridgedSessionState::Connected);
+ yesVals.insert(Added);
+ yesVals.insert(Connected);
set<BridgedSessionState> noVals;
- noVals.insert(BridgedSessionState::Disconnected);
- noVals.insert(BridgedSessionState::Done);
+ noVals.insert(Disconnected);
+ noVals.insert(Done);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> yes(yesVals);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> no(noVals);
BOOST_CHECK(yes(wrapper));
@@ -169,14 +169,14 @@ BOOST_FIXTURE_TEST_CASE(testIfInCrriteria, Fixture)
BOOST_FIXTURE_TEST_CASE(testNegation, Fixture)
{
- BridgedSessionPtr letter(createBridgedSession(BridgedSessionState::Added));
+ BridgedSessionPtr letter(createBridgedSession(Added));
SessionWrapperPtr wrapper(new SessionWrapper(letter, 0, AsteriskSCF::BridgeService::ReplicatorSmartPrx(), getLogger()));
set<BridgedSessionState> yesVals;
- yesVals.insert(BridgedSessionState::Added);
- yesVals.insert(BridgedSessionState::Connected);
+ yesVals.insert(Added);
+ yesVals.insert(Connected);
set<BridgedSessionState> noVals;
- noVals.insert(BridgedSessionState::Disconnected);
- noVals.insert(BridgedSessionState::Done);
+ noVals.insert(Disconnected);
+ noVals.insert(Done);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> yes(yesVals);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> no(noVals);
Negate<IfInCriteria<set<BridgedSessionState>, StateMemberSelector> > negYes(yes);
@@ -193,20 +193,20 @@ BOOST_FIXTURE_TEST_CASE(testCountIf, Fixture)
//
AsteriskSCF::BridgeService::ReplicatorSmartPrx rep;
vector<SessionWrapperPtr> testData;
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Added), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Added), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Disconnected), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Connected), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Done), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Added), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Disconnected), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Done), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Connected), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Added), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Added), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Disconnected), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Connected), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Done), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Added), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Disconnected), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Done), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Connected), 0, rep, getLogger()));
//
// Now a variety of test criteria.
//
- IfStateCriteria a(BridgedSessionState::Added);
+ IfStateCriteria a(Added);
CountIfOperation<IfStateCriteria> countIf(a);
countIf = for_each(testData.begin(), testData.end(), countIf);
BOOST_CHECK(countIf.count() == 3);
@@ -217,11 +217,11 @@ BOOST_FIXTURE_TEST_CASE(testCountIf, Fixture)
BOOST_CHECK((testData.size() -3) == countNotIf.count());
set<BridgedSessionState> yesVals;
- yesVals.insert(BridgedSessionState::Added);
- yesVals.insert(BridgedSessionState::Connected);
+ yesVals.insert(Added);
+ yesVals.insert(Connected);
set<BridgedSessionState> noVals;
- noVals.insert(BridgedSessionState::Disconnected);
- noVals.insert(BridgedSessionState::Done);
+ noVals.insert(Disconnected);
+ noVals.insert(Done);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> yes(yesVals);
CountIfOperation<IfInCriteria<set<BridgedSessionState>, StateMemberSelector> > countYes(yes);
countYes = for_each(testData.begin(), testData.end(), countYes);
@@ -250,22 +250,22 @@ BOOST_FIXTURE_TEST_CASE(testSelect, Fixture)
//
AsteriskSCF::BridgeService::ReplicatorSmartPrx rep;
vector<SessionWrapperPtr> testData;
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Added, "a"), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Added, "b"), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Disconnected, "a"), 0,
+ testData.push_back(new SessionWrapper(createBridgedSession(Added, "a"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Added, "b"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Disconnected, "a"), 0,
rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Connected, "c"), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Done, "a"), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Added, "b"), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Disconnected, "c"), 0, rep,
+ testData.push_back(new SessionWrapper(createBridgedSession(Connected, "c"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Done, "a"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Added, "b"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Disconnected, "c"), 0, rep,
getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Done, "a"), 0, rep, getLogger()));
- testData.push_back(new SessionWrapper(createBridgedSession(BridgedSessionState::Connected, "b"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Done, "a"), 0, rep, getLogger()));
+ testData.push_back(new SessionWrapper(createBridgedSession(Connected, "b"), 0, rep, getLogger()));
//
// Now a variety of test criteria.
//
- IfStateCriteria a(BridgedSessionState::Added);
+ IfStateCriteria a(Added);
SelectOperation<IfStateCriteria, BridgeIdSelector, vector<string> > selectIf(a);
selectIf = for_each(testData.begin(), testData.end(), selectIf);
vector<string> results = selectIf.results();
@@ -289,11 +289,11 @@ BOOST_FIXTURE_TEST_CASE(testSelect, Fixture)
BOOST_CHECK(results[index++] == "b");
set<BridgedSessionState> yesVals;
- yesVals.insert(BridgedSessionState::Added);
- yesVals.insert(BridgedSessionState::Connected);
+ yesVals.insert(Added);
+ yesVals.insert(Connected);
set<BridgedSessionState> noVals;
- noVals.insert(BridgedSessionState::Disconnected);
- noVals.insert(BridgedSessionState::Done);
+ noVals.insert(Disconnected);
+ noVals.insert(Done);
IfInCriteria<set<BridgedSessionState>, StateMemberSelector> yes(yesVals);
SelectOperation<IfInCriteria<set<BridgedSessionState>, StateMemberSelector>, BridgeIdSelector,
@@ -354,31 +354,31 @@ BOOST_FIXTURE_TEST_CASE(testGetSeq, Fixture)
SessionCollectionPtr collection(new SessionCollection(iceEnv.communicator(), "test", rep, getLogger()));
SessionPrx dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo0:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Added, dummy));
+ collection->replicaUpdate(createBridgedSession(Added, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo1:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Added, dummy));
+ collection->replicaUpdate(createBridgedSession(Added, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo2:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Disconnected, dummy));
+ collection->replicaUpdate(createBridgedSession(Disconnected, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo3:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Connected, dummy));
+ collection->replicaUpdate(createBridgedSession(Connected, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo4:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Done, dummy));
+ collection->replicaUpdate(createBridgedSession(Done, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo5:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Added, dummy));
+ collection->replicaUpdate(createBridgedSession(Added, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo6:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Disconnected, dummy));
+ collection->replicaUpdate(createBridgedSession(Disconnected, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo7:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Done, dummy));
+ collection->replicaUpdate(createBridgedSession(Done, dummy));
dummy = SessionPrx::uncheckedCast(iceEnv.communicator()->stringToProxy("foo8:default"));
- collection->replicaUpdate(createBridgedSession(BridgedSessionState::Connected, dummy));
+ collection->replicaUpdate(createBridgedSession(Connected, dummy));
//
// getSessionSeq() should only return the sessions that are *not* disconnected or destroyed.
-----------------------------------------------------------------------
--
asterisk-scf/integration/bridging.git
More information about the asterisk-scf-commits
mailing list