7 #include "fwTools/Bookmarks.hpp" 9 #include "fwTools/Object.hpp" 13 Bookmarks::Dictionary Bookmarks::m_dictionary;
17 Bookmarks::Bookmarks()
23 Bookmarks::~Bookmarks()
31 return m_dictionary.find( _id ) != m_dictionary.end();
36 void Bookmarks::add( Bookmarks::BookmarkName _bookmark, ::fwTools::Object::sptr obj )
38 OSLM_FATAL_IF(
"Try to set a Bookmarks on a null object ", !obj );
39 m_dictionary[ _bookmark ] = obj;
46 m_dictionary.erase( m_dictionary.find( _bookmark ) );
53 ::fwTools::Object::sptr bookmark;
54 Dictionary::iterator iter = m_dictionary.find( _bookmark );
55 if ( iter != m_dictionary.end() && !iter->second.expired() )
57 bookmark = iter->second.lock();
66 std::list<Bookmarks::BookmarkName> result;
67 for( Bookmarks::Dictionary::value_type elt : m_dictionary)
69 if ( !elt.second.expired() && elt.second.lock() == obj )
71 result.push_back( elt.first );
81 std::list<Bookmarks::BookmarkName> result;
82 for( Bookmarks::Dictionary::value_type elt : m_dictionary)
84 result.push_back( elt.first );
#define OSLM_FATAL_IF(message, cond)