fw4spl
GuiBaseObject.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
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 __FWGUI_GUIBASEOBJECT_HPP__
8 #define __FWGUI_GUIBASEOBJECT_HPP__
9 
10 #include <fwCore/base.hpp>
11 
12 #include "fwGui/factory/new.hpp"
13 #include "fwGui/registry/detail.hpp"
14 #include "fwGui/config.hpp"
15 
16 namespace fwGui
17 {
18 
22 class FWGUI_CLASS_API GuiBaseObject : public ::fwCore::BaseObject
23 {
24 
25 public:
26 
27  typedef ::fwGui::factory::Key Key;
28 
35  template <typename T>
36  class Registrar
37  {
38  public:
39  Registrar(std::string functorKey)
40  {
41  ::fwGui::registry::get()->addFactory(functorKey, &::fwGui::factory::New<T>);
42  }
43  };
44 
46 
47 protected:
53  {
54  }
55  virtual ~GuiBaseObject()
56  {
57  }
58 
61 };
62 
63 } // namespace fwGui
64 
65 #endif // __FWGUI_GUIBASEOBJECT_HPP__
66 
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
Base class for all FW4SPL&#39;s classes.
Definition: BaseObject.hpp:22
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Base class for all fwGui&#39;s classes.
Class used to register a class factory in factory registry. This class defines also the object factor...