fw4spl
Bookmarks.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWTOOLS_BOOKMARKS_HPP__
8 #define __FWTOOLS_BOOKMARKS_HPP__
9 
10 #include "fwTools/config.hpp"
11 
12 #include <fwCore/base.hpp>
13 
14 #include <list>
15 #include <string>
16 #include <unordered_map>
17 
18 namespace fwTools
19 {
20 
21 class Object;
27 class FWTOOLS_CLASS_API Bookmarks
28 {
29 public:
30 
31  FWTOOLS_API Bookmarks();
32 
33  typedef std::string BookmarkName;
34 
40  FWTOOLS_API static bool exist( BookmarkName _bookmark );
41 
42  FWTOOLS_API static void add( BookmarkName _bookmark, SPTR(::fwTools::Object ) ); // cannot set a empty one
43 
45  FWTOOLS_API static void remove( Bookmarks::BookmarkName _bookmark );
46 
50  FWTOOLS_API static SPTR(::fwTools::Object ) getObject( BookmarkName _bookmark );
51 
55  FWTOOLS_API static std::list<BookmarkName> getBookmarks( SPTR(::fwTools::Object ) );
56 
60  FWTOOLS_API static std::list<BookmarkName> getBookmarks();
61 
62  FWTOOLS_API virtual ~Bookmarks();
63 protected:
64 
65  typedef ::std::unordered_map< BookmarkName, WPTR(::fwTools::Object ) > Dictionary;
66 
67  static Dictionary m_dictionary;
68 };
69 
70 }
71 
72 #endif /* __FWTOOLS_BOOKMARKS_HPP__ */
#define SPTR(_cls_)
The namespace fwTools contains several tools like UUID, factory, dispatche, stringizer, macros, helper.
Define Base class for FW4SPL objects and services.
Allows to add a bookmark to an object, the bookmark name is unique (in time), an object can have seve...
Definition: Bookmarks.hpp:27