fw4spl
Extension.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/BundleElement.hpp"
10 #include "fwRuntime/config.hpp"
11 #include "fwRuntime/ConfigurationElementContainer.hpp"
12 
13 #include <libxml/tree.h>
14 
15 #include <string>
16 
17 namespace fwRuntime
18 {
19 
20 struct Bundle;
21 
22 namespace io
23 {
24 struct BundleDescriptorReader;
25 } // namespace io
26 
30 struct Extension : public BundleElement,
32 {
33  friend struct ::fwRuntime::io::BundleDescriptorReader;
34 
38  typedef enum
39  {
42  Invalid
43  } Validity;
44 
48  ~Extension();
49 
55  FWRUNTIME_API const std::string& getIdentifier() const;
56 
62  FWRUNTIME_API const std::string& getPoint() const;
63 
73  FWRUNTIME_API Validity getValidity() const;
74 
80  FWRUNTIME_API xmlNodePtr getXmlNode() const;
81 
90  FWRUNTIME_API Validity validate();
91 
92  protected:
93 
104  Extension( std::shared_ptr<Bundle> bundle, const std::string& id, const std::string& point,
105  const xmlNodePtr xmlNode );
106 
107  private:
108 
109  const std::string m_id;
110  const std::string m_point;
111  // connected to.
112  xmlDocPtr m_xmlDoc;
113  // extension
114  xmlNodePtr m_xmlNode;
115  Validity m_validity;
116 
122  void operator=(const Extension&) noexcept;
123 
124 };
125 
126 } // namespace fwRuntime
The extension passed the validation.
Definition: Extension.hpp:41
Implements the base class for all element managed by a bundle.
Defines the extension class.
Definition: Extension.hpp:30
Validity
Defines the validity states of an extension.
Definition: Extension.hpp:38
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
Defines the generic configuration element container class.
The extension has not been validated.
Definition: Extension.hpp:40