7 #include "fwMedDataTools/helper/SeriesDB.hpp" 9 #include <fwCom/Signal.hpp> 10 #include <fwCom/Signal.hxx> 11 #include <fwCom/Signals.hpp> 13 #include <fwMedData/SeriesDB.hpp> 23 m_seriesDB ( seriesDB )
37 ::fwMedData::SeriesDB::sptr seriesDB = m_seriesDB.lock();
38 OSLM_ASSERT(
"The object " << newSeries->getID() <<
" must not exist in SeriesDB.",
39 std::find(seriesDB->begin(), seriesDB->end(), newSeries) == seriesDB->end());
42 seriesDB->getContainer().push_back( newSeries );
44 m_addedSeries.push_back(newSeries);
52 ::fwMedData::SeriesDB::sptr seriesDB = m_seriesDB.lock();
54 OSLM_ASSERT(
"The object " << oldSeries->getID() <<
" must exist in SeriesDB.",
55 iter != seriesDB->end());
58 seriesDB->getContainer().erase( iter );
60 m_removedSeries.push_back( oldSeries );
68 ::fwMedData::SeriesDB::sptr seriesDB = m_seriesDB.lock();
70 while (!seriesDB->empty())
72 this->
remove(seriesDB->front());
80 ::fwMedData::SeriesDB::ContainerType& vectIn = seriesDBIn->getContainer();
81 for(::fwMedData::Series::sptr series : vectIn)
91 if (!m_addedSeries.empty())
95 sig->asyncEmit(m_addedSeries);
99 if (!m_removedSeries.empty())
103 sig->asyncEmit(m_removedSeries);
107 OSLM_INFO_IF(
"No changes were found on the SeriesDB '" + m_seriesDB.lock()->getID() +
"', nothing to notify.",
108 m_addedSeries.empty() && m_removedSeries.empty());
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
#define OSLM_INFO_IF(message, cond)
ContainerType::iterator iterator
static FWMEDDATA_APIconst::fwCom::Signals::SignalKeyType s_ADDED_SERIES_SIG
Type of signal when series are added.
static FWMEDDATA_APIconst::fwCom::Signals::SignalKeyType s_REMOVED_SERIES_SIG
Type of signal when series are added.