Orocos Real-Time Toolkit  2.9.0
FunctionFactory.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Tue Dec 21 22:43:08 CET 2004 FunctionFactory.hpp
3 
4  FunctionFactory.hpp - description
5  -------------------
6  begin : Tue December 21 2004
7  copyright : (C) 2004 Peter Soetens
8  email : peter.soetens@mech.kuleuven.ac.be
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 FUNCTIONFACTORY_HPP
40 #define FUNCTIONFACTORY_HPP
41 
42 #include "../ArgumentDescription.hpp"
43 #include "../OperationInterface.hpp"
44 #include "../Property.hpp"
45 #include "ProgramInterface.hpp"
46 
47 #include <map>
48 #include <string>
49 
50 namespace RTT
51 { namespace scripting {
52 
58  : public OperationInterfacePart
59  {
61  ExecutionEngine* proc;
62 
64  const std::vector<base::DataSourceBase::shared_ptr>& args
65  , ExecutionEngine* caller, bool issend
66  ) const;
67  public:
69 
70  std::string resultType() const;
71 
72  unsigned int arity() const;
73 
74  unsigned int collectArity() const;
75 
76  const types::TypeInfo* getArgumentType(unsigned int arg) const;
77 
78  const types::TypeInfo* getCollectType(unsigned int arg) const;
79 
80  std::string getName() const;
81 
82  std::string description() const;
83 
84  std::vector< ArgumentDescription > getArgumentList() const;
85 
86  base::DataSourceBase::shared_ptr produce(const std::vector<base::DataSourceBase::shared_ptr>& args, ExecutionEngine* caller
87  ) const;
89  base::DataSourceBase::shared_ptr produceSend(const std::vector<base::DataSourceBase::shared_ptr>& args, ExecutionEngine* caller
90  ) const;
91  base::DataSourceBase::shared_ptr produceCollect(const std::vector<base::DataSourceBase::shared_ptr>& args, internal::DataSource<bool>::shared_ptr blocking
92  ) const;
93 
94 #ifdef ORO_SIGNALLING_OPERATIONS
95  Handle produceSignal(base::ActionInterface* func, const std::vector<base::DataSourceBase::shared_ptr>& args, ExecutionEngine* subscriber) const;
96 #endif
97  };
98 }}
99 
100 #endif
std::string resultType() const
Return the result (return) type of this operation.
const types::TypeInfo * getCollectType(unsigned int arg) const
Returns the type information of the n&#39;th collectable argument.
std::string getName() const
Returns the name of this operation.
unsigned int collectArity() const
Returns the number of collectable arguments of this operation&#39;s function.
base::DataSourceBase::shared_ptr produceCollect(const std::vector< base::DataSourceBase::shared_ptr > &args, internal::DataSource< bool >::shared_ptr blocking) const
Create a DataSource for collecting the results of a Send.
boost::shared_ptr< ProgramInterface > ProgramInterfacePtr
An execution engine serialises (executes one after the other) the execution of all commands...
const types::TypeInfo * getArgumentType(unsigned int arg) const
Returns the type information of the n&#39;th argument, with argument zero being the return value...
Based on the software pattern &#39;command&#39;, this interface allows execution of action objects...
base::DataSourceBase::shared_ptr produce(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
Create a DataSource for a given callable operation.
std::string description() const
Returns the description of this operation.
A class for representing a user type, and which can build instances of that type. ...
Definition: TypeInfo.hpp:67
std::vector< ArgumentDescription > getArgumentList() const
Get a description of the desired arguments in the ArgumentDescription format.
This class defines the interface for creating operation objects without using C++ templates...
boost::intrusive_ptr< DataSource< T > > shared_ptr
Definition: DataSource.hpp:115
unsigned int arity() const
Returns the arity (number of arguments) of this operation.
base::DataSourceBase::shared_ptr produceSend(const std::vector< base::DataSourceBase::shared_ptr > &args, ExecutionEngine *caller) const
Create a DataSource for a given send operation.
A Factory which delivers operations which execute a FunctionGraph in an engine.
base::DataSourceBase::shared_ptr produceHandle() const
Create an empty SendHandle object for this operation.
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:52
The Handle holds the information, and allows manipulation, of a connection between a internal::Signal...
Definition: Handle.hpp:66
FunctionFactory(ProgramInterfacePtr func, ExecutionEngine *procs)