source: finroc_plugins_runtime_construction/tCreateFrameworkElementAction.h @ 93:6f2168f87ee4

17.03
Last change on this file since 93:6f2168f87ee4 was 93:6f2168f87ee4, checked in by Max Reichardt <mreichardt@…>, 3 years ago

Makes CreateFrameworkElementActions use a 32 bit handle

File size: 4.9 KB
Line 
1//
2// You received this file as part of Finroc
3// A framework for intelligent robot control
4//
5// Copyright (C) Finroc GbR (finroc.org)
6//
7// This program is free software; you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation; either version 2 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License along
18// with this program; if not, write to the Free Software Foundation, Inc.,
19// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20//
21//----------------------------------------------------------------------
22/*!\file    plugins/runtime_construction/tCreateFrameworkElementAction.h
23 *
24 * \author  Max Reichardt
25 *
26 * \date    2012-12-02
27 *
28 * \brief   Contains tCreateFrameworkElementAction
29 *
30 * \b tCreateFrameworkElementAction
31 *
32 * Classes that implement this interface provide a generic method for
33 * creating modules/groups etc.
34 *
35 * When such actions are instantiated, they are automatically added to list of constructible elements.
36 */
37//----------------------------------------------------------------------
38#ifndef __plugins__runtime_construction__tCreateFrameworkElementAction_h__
39#define __plugins__runtime_construction__tCreateFrameworkElementAction_h__
40
41//----------------------------------------------------------------------
42// External includes (system with <>, local with "")
43//----------------------------------------------------------------------
44
45//----------------------------------------------------------------------
46// Internal includes with ""
47//----------------------------------------------------------------------
48#include "plugins/runtime_construction/tConstructorParameters.h"
49#include "plugins/runtime_construction/tSharedLibrary.h"
50
51//----------------------------------------------------------------------
52// Namespace declaration
53//----------------------------------------------------------------------
54namespace finroc
55{
56namespace runtime_construction
57{
58
59//----------------------------------------------------------------------
60// Forward declarations / typedefs / enums
61//----------------------------------------------------------------------
62
63//----------------------------------------------------------------------
64// Class declaration
65//----------------------------------------------------------------------
66//! Base class for all actions that are available for creating framework elements.
67/*!
68 * Classes that implement this interface provide a generic method for
69 * creating modules/groups etc.
70 *
71 * When such actions are instantiated, they are automatically added to list of constructible elements.
72 */
73class tCreateFrameworkElementAction : private rrlib::util::tNoncopyable
74{
75
76//----------------------------------------------------------------------
77// Public methods and typedefs
78//----------------------------------------------------------------------
79public:
80
81  typedef rrlib::serialization::tRegister<tCreateFrameworkElementAction*, 64, 128, uint32_t> tRegister;
82
83  tCreateFrameworkElementAction();
84
85  virtual ~tCreateFrameworkElementAction() = default;
86
87  /*!
88   * Create Module (or Group)
89   *
90   * \param name Name of instantiated module
91   * \param parent Parent of instantiated module
92   * \param params Parameters
93   * \return Created Module (or Group)
94   */
95  virtual core::tFrameworkElement* CreateModule(core::tFrameworkElement* parent, const std::string& name, tConstructorParameters* params = nullptr) const = 0;
96
97  /*!
98   * \return Returns .so file in which address provided as argument is found by dladdr
99   */
100  tSharedLibrary GetBinary(void* addr);
101
102  /*!
103   * \return List with framework element types that can be instantiated in this runtime using this standard mechanism
104   */
105  static const tRegister& GetConstructibleElements();
106
107  /*!
108   * \return Returns name of group to which this create module action belongs
109   */
110  virtual tSharedLibrary GetModuleGroup() const = 0;
111
112  /*!
113   * \return Name of module type to be created
114   */
115  virtual std::string GetName() const = 0;
116
117  /*!
118   * \return Returns types of parameters that the create method requires
119   */
120  virtual const tConstructorParameters* GetParameterTypes() const = 0;
121
122  /*!
123   * \return Whether create action is deprecated;
124   */
125  virtual bool IsDeprecated() const;
126
127//----------------------------------------------------------------------
128// Private fields and methods
129//----------------------------------------------------------------------
130private:
131
132};
133
134//----------------------------------------------------------------------
135// End of namespace declaration
136//----------------------------------------------------------------------
137}
138}
139
140
141#endif
Note: See TracBrowser for help on using the repository browser.