fw4spl
BundleElement.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwRuntime/config.hpp"
10 
11 #include <memory>
12 
13 namespace fwRuntime
14 {
15 struct Bundle;
16 }
17 
18 namespace fwRuntime
19 {
20 
25 {
26 
32  FWRUNTIME_API std::shared_ptr<Bundle> getBundle() const;
33 
45  FWRUNTIME_API bool isEnable() const;
46 
54  FWRUNTIME_API void setEnable(const bool enable);
55 
56  protected:
57 
67  BundleElement();
68 
75  BundleElement( std::shared_ptr< Bundle > bundle );
76 
77  private:
78 
79  std::weak_ptr< Bundle > m_bundle;
80  bool m_enable;
81 
82 };
83 
84 } // namespace fwRuntime
Implements the base class for all element managed by a bundle.
FWRUNTIME_API void setEnable(const bool enable)
Set if the element is enabled or not.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
BundleElement()
Constructor.
FWRUNTIME_API std::shared_ptr< Bundle > getBundle() const
Retrieves the bundle that owns the extension.
FWRUNTIME_API bool isEnable() const
Tells if the element is enabled or not.