Pothos  0.4.0-gd11861cd
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
Class.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 #include <Pothos/Config.hpp>
14 #include <string>
15 #include <memory>
16 #include <typeinfo>
17 
18 namespace Pothos {
19 
25 {
26 public:
27 
31  static ManagedClass lookup(const std::type_info &type);
32 
34  ManagedClass(void);
35 
41  template <typename ClassType>
42  ManagedClass &registerClass(void);
43 
48  template <typename ClassType, typename BaseClassType>
49  ManagedClass &registerBaseClass(void);
50 
56  ManagedClass &registerToBaseClass(const Callable &toBase);
57 
62  template <typename ClassType, typename... ArgsType>
63  ManagedClass &registerConstructor(void);
64 
69  template <typename ReturnType, typename... ArgsType>
70  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(ArgsType...));
71 
77  template <typename ReturnType, typename ClassType, typename... ArgsType>
78  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(ArgsType...));
79 
85  template <typename ReturnType, typename ClassType, typename... ArgsType>
86  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(ArgsType...) const);
87 
98  template <typename ClassType, typename ValueType>
99  ManagedClass &registerField(const std::string &name, ValueType ClassType::*member);
100 
106  ManagedClass &registerReferenceToWrapper(const Callable &toPointer);
107 
113  ManagedClass &registerPointerToWrapper(const Callable &toPointer);
114 
120  ManagedClass &registerSharedToWrapper(const Callable &toPointer);
121 
127  ManagedClass &registerConstructor(const Callable &constructor);
128 
133  ManagedClass &registerStaticMethod(const std::string &name, const Callable &method);
134 
140  ManagedClass &registerMethod(const std::string &name, const Callable &method);
141 
146  ManagedClass &registerOpaqueConstructor(const Callable &constructor);
147 
151  template <typename ClassType>
152  ManagedClass &registerOpaqueConstructor(void);
153 
158  ManagedClass &registerOpaqueStaticMethod(const std::string &name, const Callable &method);
159 
164  ManagedClass &registerWildcardStaticMethod(const Callable &method);
165 
171  ManagedClass &registerOpaqueMethod(const std::string &name, const Callable &method);
172 
178  ManagedClass &registerWildcardMethod(const Callable &method);
179 
187  ManagedClass &commit(const std::string &classPath);
188 
196  static void unload(const std::string &classPath);
197 
204  const std::type_info &type(void) const;
205 
210  const std::type_info &pointerType(void) const;
211 
216  const std::type_info &sharedType(void) const;
217 
221  const Callable &getReferenceToWrapper(void) const;
222 
226  const Callable &getPointerToWrapper(void) const;
227 
231  const Callable &getSharedToWrapper(void) const;
232 
237  const std::vector<Callable> &getBaseClassConverters(void) const;
238 
243  const std::vector<Callable> &getConstructors(void) const;
244 
251  const std::vector<Callable> &getStaticMethods(const std::string &name) const;
252 
259  const std::vector<Callable> &getMethods(const std::string &name) const;
260 
266  const Callable &getOpaqueConstructor(void) const;
267 
275  const Callable &getOpaqueStaticMethod(const std::string &name) const;
276 
283  const Callable &getWildcardStaticMethod(void) const;
284 
292  const Callable &getOpaqueMethod(const std::string &name) const;
293 
300  const Callable &getWildcardMethod(void) const;
301 
302 private:
303  struct Impl;
304  std::shared_ptr<Impl> _impl;
305 };
306 
307 } //namespace Pothos
#define POTHOS_API
Definition: Config.hpp:41
Definition: Callable.hpp:30
Definition: Class.hpp:24