7 #include "fwDataTools/helper/Vector.hpp" 9 #include <fwCom/Signal.hpp> 10 #include <fwCom/Signal.hxx> 11 #include <fwCom/Signals.hpp> 13 #include <fwData/Vector.hpp> 31 if(!m_addedObjects.empty() || !m_removedObjects.empty())
41 ::fwData::Vector::sptr vector = m_vector.lock();
42 OSLM_ASSERT(
"The object " << _newObject->getID() <<
" must not exist in vector.",
43 std::find(vector->begin(), vector->end(), _newObject) == vector->end());
46 vector->getContainer().push_back(_newObject );
48 m_addedObjects.push_back(_newObject);
55 ::fwData::Vector::sptr vector = m_vector.lock();
57 OSLM_ASSERT(
"The object " << _oldObject->getID() <<
" must exist in vector.",
58 iter != vector->end());
61 vector->getContainer().erase( iter );
63 m_removedObjects.push_back(_oldObject);
71 ::fwData::Vector::sptr vector = m_vector.lock();
73 while (!vector->empty())
75 this->
remove(vector->front());
83 if ( !m_removedObjects.empty() )
87 sig->asyncEmit(m_removedObjects);
89 if ( !m_addedObjects.empty() )
93 sig->asyncEmit(m_addedObjects);
95 OSLM_INFO_IF(
"No changes were found on the vector '" + m_vector.lock()->getID() +
"', nothing to notify.",
96 m_addedObjects.empty() && m_removedObjects.empty());
98 m_removedObjects.clear();
99 m_addedObjects.clear();
ContainerType::iterator iterator
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_ADDED_OBJECTS_SIG
Type of signal when objects are added.
#define OSLM_INFO_IF(message, cond)
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_REMOVED_OBJECTS_SIG
Type of signal when objects are added.