0ad/source/tools/atlas/AtlasUI/General/Observable.cpp
Ykkrosh 914e5f7c2f Rename stdafx.h to precompiled.h
This was SVN commit r5146.
2007-06-05 18:35:05 +00:00

22 lines
597 B
C++

#include "precompiled.h"
#include "Observable.h"
void ObservableScopedConnections::Add(const ObservableConnection& conn)
{
// Clean up any disconnected connections that might be left in here
m_Conns.erase(
remove_if(m_Conns.begin(), m_Conns.end(),
not1(std::mem_fun_ref(&ObservableConnection::connected))),
m_Conns.end()
);
// Add the new connection
m_Conns.push_back(conn);
}
ObservableScopedConnections::~ObservableScopedConnections()
{
// Disconnect all connections that we hold
for_each(m_Conns.begin(), m_Conns.end(), std::mem_fun_ref(&ObservableConnection::disconnect));
}