Pothos  0.2.1-g9f04573d
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
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>
63  ManagedClass &registerConstructor(void);
64 
68  template <typename ReturnType>
69  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)());
70 
75  template <typename ReturnType, typename ClassType>
76  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)());
77 
82  template <typename ReturnType, typename ClassType>
83  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)() const);
88  template <typename ClassType, typename A0>
89  ManagedClass &registerConstructor(void);
90 
94  template <typename A0, typename ReturnType>
95  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0));
96 
101  template <typename A0, typename ReturnType, typename ClassType>
102  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0));
103 
108  template <typename A0, typename ReturnType, typename ClassType>
109  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0) const);
114  template <typename ClassType, typename A0, typename A1>
115  ManagedClass &registerConstructor(void);
116 
120  template <typename A0, typename A1, typename ReturnType>
121  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1));
122 
127  template <typename A0, typename A1, typename ReturnType, typename ClassType>
128  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1));
129 
134  template <typename A0, typename A1, typename ReturnType, typename ClassType>
135  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1) const);
140  template <typename ClassType, typename A0, typename A1, typename A2>
141  ManagedClass &registerConstructor(void);
142 
146  template <typename A0, typename A1, typename A2, typename ReturnType>
147  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2));
148 
153  template <typename A0, typename A1, typename A2, typename ReturnType, typename ClassType>
154  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2));
155 
160  template <typename A0, typename A1, typename A2, typename ReturnType, typename ClassType>
161  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2) const);
166  template <typename ClassType, typename A0, typename A1, typename A2, typename A3>
167  ManagedClass &registerConstructor(void);
168 
172  template <typename A0, typename A1, typename A2, typename A3, typename ReturnType>
173  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3));
174 
179  template <typename A0, typename A1, typename A2, typename A3, typename ReturnType, typename ClassType>
180  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3));
181 
186  template <typename A0, typename A1, typename A2, typename A3, typename ReturnType, typename ClassType>
187  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3) const);
192  template <typename ClassType, typename A0, typename A1, typename A2, typename A3, typename A4>
193  ManagedClass &registerConstructor(void);
194 
198  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename ReturnType>
199  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3, A4));
200 
205  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename ReturnType, typename ClassType>
206  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4));
207 
212  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename ReturnType, typename ClassType>
213  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4) const);
218  template <typename ClassType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5>
219  ManagedClass &registerConstructor(void);
220 
224  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename ReturnType>
225  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3, A4, A5));
226 
231  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename ReturnType, typename ClassType>
232  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5));
233 
238  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename ReturnType, typename ClassType>
239  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5) const);
244  template <typename ClassType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
245  ManagedClass &registerConstructor(void);
246 
250  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename ReturnType>
251  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3, A4, A5, A6));
252 
257  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename ReturnType, typename ClassType>
258  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6));
259 
264  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename ReturnType, typename ClassType>
265  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6) const);
270  template <typename ClassType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7>
271  ManagedClass &registerConstructor(void);
272 
276  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename ReturnType>
277  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3, A4, A5, A6, A7));
278 
283  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename ReturnType, typename ClassType>
284  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6, A7));
285 
290  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename ReturnType, typename ClassType>
291  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6, A7) const);
296  template <typename ClassType, typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8>
297  ManagedClass &registerConstructor(void);
298 
302  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename ReturnType>
303  ManagedClass &registerStaticMethod(const std::string &name, ReturnType(*method)(A0, A1, A2, A3, A4, A5, A6, A7, A8));
304 
309  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename ReturnType, typename ClassType>
310  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6, A7, A8));
311 
316  template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename ReturnType, typename ClassType>
317  ManagedClass &registerMethod(const std::string &name, ReturnType(ClassType::*method)(A0, A1, A2, A3, A4, A5, A6, A7, A8) const);
318 
329  template <typename ClassType, typename ValueType>
330  ManagedClass &registerField(const std::string &name, ValueType ClassType::*member);
331 
337  ManagedClass &registerReferenceToWrapper(const Callable &toPointer);
338 
344  ManagedClass &registerPointerToWrapper(const Callable &toPointer);
345 
351  ManagedClass &registerSharedToWrapper(const Callable &toPointer);
352 
358  ManagedClass &registerConstructor(const Callable &constructor);
359 
364  ManagedClass &registerStaticMethod(const std::string &name, const Callable &method);
365 
371  ManagedClass &registerMethod(const std::string &name, const Callable &method);
372 
377  ManagedClass &registerOpaqueConstructor(const Callable &constructor);
378 
382  template <typename ClassType>
383  ManagedClass &registerOpaqueConstructor(void);
384 
389  ManagedClass &registerOpaqueStaticMethod(const std::string &name, const Callable &method);
390 
395  ManagedClass &registerWildcardStaticMethod(const Callable &method);
396 
402  ManagedClass &registerOpaqueMethod(const std::string &name, const Callable &method);
403 
409  ManagedClass &registerWildcardMethod(const Callable &method);
410 
418  ManagedClass &commit(const std::string &classPath);
419 
427  static void unload(const std::string &classPath);
428 
435  const std::type_info &type(void) const;
436 
441  const std::type_info &pointerType(void) const;
442 
447  const std::type_info &sharedType(void) const;
448 
452  const Callable &getReferenceToWrapper(void) const;
453 
457  const Callable &getPointerToWrapper(void) const;
458 
462  const Callable &getSharedToWrapper(void) const;
463 
468  const std::vector<Callable> &getBaseClassConverters(void) const;
469 
474  const std::vector<Callable> &getConstructors(void) const;
475 
482  const std::vector<Callable> &getStaticMethods(const std::string &name) const;
483 
490  const std::vector<Callable> &getMethods(const std::string &name) const;
491 
497  const Callable &getOpaqueConstructor(void) const;
498 
506  const Callable &getOpaqueStaticMethod(const std::string &name) const;
507 
514  const Callable &getWildcardStaticMethod(void) const;
515 
523  const Callable &getOpaqueMethod(const std::string &name) const;
524 
531  const Callable &getWildcardMethod(void) const;
532 
533 private:
534  struct Impl;
535  std::shared_ptr<Impl> _impl;
536 };
537 
538 } //namespace Pothos
#define POTHOS_API
Definition: Config.hpp:41
Definition: Callable.tmpl.hpp:30
Definition: Class.hpp:24