fw4spl
ConfigurationElementContainer.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 __FWRUNTIME_CONFIGURATIONELEMENTCONTAINER_HPP__
8 #define __FWRUNTIME_CONFIGURATIONELEMENTCONTAINER_HPP__
9 
10 #include "fwRuntime/config.hpp"
11 
12 #include <iterator>
13 #include <memory>
14 #include <vector>
15 
16 namespace fwRuntime
17 {
18 
19 namespace io
20 {
21 struct BundleDescriptorReader;
22 } // namespace io
23 
24 struct ConfigurationElement;
25 
29 struct FWRUNTIME_CLASS_API ConfigurationElementContainer
30 {
31  friend struct BundleDescriptorReader;
32 
39  typedef std::vector< std::shared_ptr<ConfigurationElement> > Container;
42  typedef Container::iterator Iterator;
43 
45 
52  FWRUNTIME_API Iterator begin();
53 
59  FWRUNTIME_API Iterator end();
60 
66  FWRUNTIME_API const Container& getElements() const;
67 
75  FWRUNTIME_API const std::shared_ptr< ConfigurationElement > findConfigurationElement( const std::string& name )
76  const;
77 
85  FWRUNTIME_API bool hasConfigurationElement( const std::string& name ) const;
86 
94  FWRUNTIME_API ConfigurationElementContainer findAllConfigurationElement( const std::string& name ) const;
95 
100  FWRUNTIME_API size_t size() const;
101 
102  protected:
103 
109  FWRUNTIME_API void addConfigurationElement( std::shared_ptr< ConfigurationElement > element );
110 
111  private:
112 
113  Container m_elements;
114 
115 };
116 
117 } // namespace fwRuntime
118 
119 #endif // __FWRUNTIME_CONFIGURATIONELEMENTCONTAINER_HPP__
FWRUNTIME_API std::shared_ptr< ConfigurationElement > findConfigurationElement(const std::string &identifier, const std::string &pointIdentifier)
Retrieve the configuation element with the given identifier for the given extension point...
Definition: operations.cpp:56
std::vector< std::shared_ptr< ConfigurationElement > > Container
Defines the configuration element container type.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
Defines the generic configuration element container class.
Container::iterator Iterator
Defines the configuration element container type.