anatomist  5.1.2
3D neuroimaging data viewer
module.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef ANATOMIST_APPLICATION_MODULE_H
36 #define ANATOMIST_APPLICATION_MODULE_H
37 
38 
40 #include <list>
41 #include <string>
42 
43 
44 class Tree;
45 
46 namespace anatomist
47 {
48 
50  {
51  public:
52  Module();
53  virtual ~Module() = 0;
54  void init();
55 
56  virtual std::string name() const = 0;
57  virtual std::string description() const = 0;
58 
59  virtual Tree* controlWinOptions() const;
60 
61  protected:
62  virtual void objectsDeclaration();
64  virtual void viewsDeclaration();
65  virtual void actionsDeclaration();
66  virtual void controlsDeclaration();
67  virtual void controlGroupsDeclaration();
68  };
69 
71  {
72  friend class Module;
73 
74  public:
75  typedef std::list<Module*>::iterator iterator;
76  typedef std::list<Module*>::const_iterator const_iterator;
77  typedef std::list<Module*>::reverse_iterator reverse_iterator;
78  typedef std::list<Module*>::const_reverse_iterator const_reverse_iterator;
79  typedef std::list<Module*>::size_type size_type;
81  iterator begin() { return my_modules.begin(); }
82  iterator end() { return my_modules.end(); }
83  reverse_iterator rbegin() { return my_modules.rbegin(); }
84  reverse_iterator rend() { return my_modules.rend(); }
85  bool empty() const { return my_modules.empty(); }
86  size_type size() const { return my_modules.size(); }
89  static void shutdown();
90 
91  protected:
92  void insert( Module* m ) { my_modules.push_back( m ); }
93  void remove( Module* m ) { my_modules.remove( m ); }
94 
95  private:
96  ModuleManager();
97 
98  std::list<Module*> my_modules;
99  static ModuleManager* my_manager;
100  };
101 
103  {
104  public:
105  };
106 
108  {
109  public:
110  };
111 
112 
113 }
114 
115 
156 #endif
#define ANATOMIST_API
Represent the Anatomist internals made available to Modules.
Definition: module.h:108
Manage Anatomist modules.
Definition: module.h:71
std::list< Module * >::const_reverse_iterator const_reverse_iterator
Definition: module.h:78
static void shutdown()
delete the module manager
std::list< Module * >::size_type size_type
Definition: module.h:79
void insert(Module *m)
Definition: module.h:92
bool empty() const
Definition: module.h:85
std::list< Module * >::const_iterator const_iterator
Definition: module.h:76
reverse_iterator rend()
Definition: module.h:84
std::list< Module * >::reverse_iterator reverse_iterator
Definition: module.h:77
size_type size() const
Definition: module.h:86
void remove(Module *m)
Definition: module.h:93
std::list< Module * >::iterator iterator
Definition: module.h:75
static ModuleManager * instance()
reverse_iterator rbegin()
Definition: module.h:83
iterator begin()
Definition: module.h:81
Base class for objects interested in module changes notification.
Definition: module.h:103
Base class for dynamically loaded modules.
Definition: module.h:50
virtual void viewsDeclaration()
virtual void actionsDeclaration()
virtual void objectsDeclaration()
virtual Tree * controlWinOptions() const
virtual void controlsDeclaration()
virtual void objectPropertiesDeclaration()
virtual std::string name() const =0
virtual ~Module()=0
virtual std::string description() const =0
virtual void controlGroupsDeclaration()