Pothos  0.2.1-g9f04573d
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
CallInterface.tmpl.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
13 #include <Pothos/Object/Object.hpp>
14 
15 namespace Pothos {
16 
22 {
23 public:
27  virtual ~CallInterface(void);
28 
29  #for $NARGS in range($MAX_ARGS)
30  template <typename ReturnType, $expand('typename A%d', $NARGS)>
32  ReturnType call($expand('A%d &&a%d', $NARGS)) const;
33 
35  template <$expand('typename A%d', $NARGS)>
36  Object callObject($expand('A%d &&a%d', $NARGS)) const;
37 
39  template <$expand('typename A%d', $NARGS)>
40  void callVoid($expand('A%d &&a%d', $NARGS)) const;
41 
42  #end for
43 
44 protected:
52  virtual Object opaqueCall(const Object *inputArgs, const size_t numArgs) const = 0;
53 };
54 
55 } //namespace Pothos
56 
58 {
59  return this->opaqueCall(nullptr, 0);
60 }
61 
62 inline void Pothos::CallInterface::callVoid(void) const
63 {
64  this->callObject();
65 }
virtual Object opaqueCall(const Object *inputArgs, const size_t numArgs) const =0
Object callObject() const
Call a bound method/function with an Object return and 0 args.
Definition: CallInterface.tmpl.hpp:57
#define POTHOS_API
Definition: Config.hpp:41
void callVoid() const
Call a bound method/function with a void return and 0 args.
Definition: CallInterface.tmpl.hpp:62
Definition: CallInterface.tmpl.hpp:21
Definition: Object.hpp:55