OperationInterface.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: The SourceWorks Tue Sep 7 00:55:18 CEST 2010 OperationInterface.hpp
3 
4  OperationInterface.hpp - description
5  -------------------
6  begin : Tue September 07 2010
7  copyright : (C) 2010 The SourceWorks
8  email : peter@thesourceworks.com
9 
10  ***************************************************************************
11  * This library is free software; you can redistribute it and/or *
12  * modify it under the terms of the GNU General Public *
13  * License as published by the Free Software Foundation; *
14  * version 2 of the License. *
15  * *
16  * As a special exception, you may use this file as part of a free *
17  * software library without restriction. Specifically, if other files *
18  * instantiate templates or use macros or inline functions from this *
19  * file, or you compile this file and link it with other files to *
20  * produce an executable, this file does not by itself cause the *
21  * resulting executable to be covered by the GNU General Public *
22  * License. This exception does not however invalidate any other *
23  * reasons why the executable file might be covered by the GNU General *
24  * Public License. *
25  * *
26  * This library is distributed in the hope that it will be useful, *
27  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
28  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
29  * Lesser General Public License for more details. *
30  * *
31  * You should have received a copy of the GNU General Public *
32  * License along with this library; if not, write to the Free Software *
33  * Foundation, Inc., 59 Temple Place, *
34  * Suite 330, Boston, MA 02111-1307 USA *
35  * *
36  ***************************************************************************/
37 
38 
39 #ifndef ORO_OPERATION_REPOSITORY_HPP
40 #define ORO_OPERATION_REPOSITORY_HPP
41 
42 #include <string>
43 #include <vector>
44 #include <map>
45 
46 #include "rtt-config.h"
47 #include "base/DataSourceBase.hpp"
48 #include "internal/DataSource.hpp"
49 #include "ArgumentDescription.hpp"
50 #include "FactoryExceptions.hpp"
52 
53 
54 namespace RTT
55 {
62  class RTT_API OperationInterface
63  {
64  protected:
65  typedef std::map<std::string, OperationInterfacePart*> map_t;
66  map_t data;
67  public:
71  typedef std::vector<base::DataSourceBase::shared_ptr> Arguments;
72 
76  void clear();
77 
81  std::vector<std::string> getNames() const;
82 
86  bool hasMember(const std::string& name) const;
87 
96  int getArity(const std::string& name) const;
97 
107  int getCollectArity(const std::string& name) const;
108 
114  bool isSynchronous(const std::string& name) const;
115 
128  base::DataSourceBase::shared_ptr produce(const std::string& name, const Arguments& args, ExecutionEngine* caller) const;
129 
144  base::DataSourceBase::shared_ptr produceSend(const std::string& name, const Arguments& args, ExecutionEngine* caller) const;
145 
160  base::DataSourceBase::shared_ptr produceHandle(const std::string& name) const;
161 
178  base::DataSourceBase::shared_ptr produceCollect(const std::string& name, const Arguments& args, internal::DataSource<bool>::shared_ptr blocking) const;
179 
180 #ifdef ORO_SIGNALLING_OPERATIONS
181 
199  Handle produceSignal(const std::string& name, base::ActionInterface* func, const std::vector<base::DataSourceBase::shared_ptr>& args, ExecutionEngine* subscriber) const;
200 #endif
201 
204  typedef std::vector<ArgumentDescription> Descriptions;
205 
214  Descriptions getArgumentList(const std::string& name) const;
215 
224  std::string getResultType(const std::string& name) const;
225 
234  std::string getDescription(const std::string& name) const;
235 
242  void add(const std::string& name, OperationInterfacePart* part);
243 
249  void remove(const std::string& name);
250 
256  OperationInterfacePart* getPart(const std::string& name);
257  };
258 }
259 
260 #endif
std::vector< ArgumentDescription > Descriptions
Based on the software pattern &#39;command&#39;, this interface allows execution of action objects...
boost::intrusive_ptr< DataSource< T > > shared_ptr
Definition: DataSource.hpp:115
std::map< std::string, OperationInterfacePart * > map_t
std::vector< base::DataSourceBase::shared_ptr > Arguments
boost::intrusive_ptr< DataSourceBase > shared_ptr
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:53
The Handle holds the information, and allows manipulation, of a connection between a internal::Signal...
Definition: Handle.hpp:66
Holds all exported operations of a component and is able to produce callers for these operations...


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:25