OpenWalnut  1.4.0
WModuleWrapper.h
1 //---------------------------------------------------------------------------
2 //
3 // Project: OpenWalnut ( http://www.openwalnut.org )
4 //
5 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6 // For more information see http://www.openwalnut.org/copying
7 //
8 // This file is part of OpenWalnut.
9 //
10 // OpenWalnut is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU Lesser General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // OpenWalnut is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public License
21 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 //
23 //---------------------------------------------------------------------------
24 
25 #ifndef WMODULEWRAPPER_H
26 #define WMODULEWRAPPER_H
27 
28 #include <string>
29 
30 #ifndef Q_MOC_RUN
31 #include <boost/shared_ptr.hpp>
32 #endif
33 
34 #include "core/kernel/WModule.h"
35 
36 #include "WPropertyGroupWrapper.h"
37 #include "WInputConnectorWrapper.h"
38 #include "WOutputConnectorWrapper.h"
39 
40 /**
41  * \class WModuleWrapper
42  *
43  * A wrapper for a module. This is used to expose a part of the WModule functionality
44  * to script interpreters.
45  */
47 {
48 public:
49  /**
50  * Constructor.
51  *
52  * \param module The actual module.
53  */
54  explicit WModuleWrapper( boost::shared_ptr< WModule > module );
55 
56  /**
57  * Destructor.
58  */
60 
61  /**
62  * Get the name of the module.
63  *
64  * \return The name of the module.
65  */
66  std::string getName() const;
67 
68  /**
69  * Get the description of the module.
70  *
71  * \return The description.
72  */
73  std::string getDescription() const;
74 
75  /**
76  * Returns the module pointer. Useful to other wrapper classes.
77  *
78  * \return The module pointer.
79  */
80  boost::shared_ptr< WModule > getModulePtr();
81 
82  /**
83  * Returns a WPropertyGroupWrapper containing the module's properties. To be used in scripts.
84  *
85  * \return The module's properties.
86  */
88 
89  /**
90  * Returns a WPropertyGroupWrapper containing the module's info properties. To be used in scripts.
91  *
92  * \return The module's properties.
93  */
95 
96  /**
97  * Get an input connector by name.
98  *
99  * \param name The name of the connector.
100  * \return The retrieved connector.
101  */
102  WInputConnectorWrapper getInputConnector( std::string const& name );
103 
104  /**
105  * Get an output connector by name.
106  *
107  * \param name The name of the connector.
108  * \return The retrieved connector.
109  */
110  WOutputConnectorWrapper getOutputConnector( std::string const& name );
111 
112 private:
113  //! A pointer to the module.
114  boost::shared_ptr< WModule > m_module;
115 };
116 
117 #endif // WMODULEWRAPPER_H
A wrapper for output connectors.
A wrapper for a module.
WPropertyGroupWrapper getProperties()
Returns a WPropertyGroupWrapper containing the module's properties.
Encapsulates a property group.
std::string getName() const
Get the name of the module.
~WModuleWrapper()
Destructor.
boost::shared_ptr< WModule > m_module
A pointer to the module.
std::string getDescription() const
Get the description of the module.
WPropertyGroupWrapper getInformationProperties()
Returns a WPropertyGroupWrapper containing the module's info properties.
boost::shared_ptr< WModule > getModulePtr()
Returns the module pointer.
WOutputConnectorWrapper getOutputConnector(std::string const &name)
Get an output connector by name.
A wrapper for input connectors.
WModuleWrapper(boost::shared_ptr< WModule > module)
Constructor.
WInputConnectorWrapper getInputConnector(std::string const &name)
Get an input connector by name.