- Aldebaran documentation |
- C++ Libraries |
- index

libqi-api 2.8.7.4

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
metamethod.hpp
Go to the documentation of this file.
1 #pragma once
2 /*
3 ** Copyright (C) 2013 Aldebaran Robotics
4 ** See COPYING for the license
5 */
6
7 #ifndef _QI_TYPE_METAMETHOD_HPP_
8 #define _QI_TYPE_METAMETHOD_HPP_
9
10 # include <string>
11 # include <map>
12
13 # include <qi/api.hpp>
14 # include <qi/type/typeinterface.hpp>
15
16 # ifdef _MSC_VER
17 # pragma warning( push )
18 # pragma warning( disable: 4251 )
19 # endif
20
21 namespace qi {
22 class MetaMethodParameterPrivate;
23 class AnyFunction;
24 class QI_API MetaMethodParameter {
25 public:
26 MetaMethodParameter();
27 MetaMethodParameter(const MetaMethodParameter& other);
28 MetaMethodParameter(const std::string& name, const std::string& doc);
29 ~MetaMethodParameter();
30
31 MetaMethodParameter& operator= (const MetaMethodParameter& other);
32
33 std::string name() const;
34 std::string description() const;
35
36 MetaMethodParameterPrivate* _p;
37 };
38 using MetaMethodParameterVector = std::vector<MetaMethodParameter>;
39
40 class MetaMethodPrivate;
42 class QI_API MetaMethod {
43 public:
44 MetaMethod();
45 MetaMethod(unsigned int newUid, const MetaMethod& other);
46
47 unsigned int uid() const;
48 const std::string& name() const;
49 std::string toString() const; //< name::(args)
50 const Signature& parametersSignature() const;
51 const Signature& returnSignature() const;
52 std::string description() const;
53 MetaMethodParameterVector parameters() const;
54 std::string returnDescription() const;
55
58 bool isPrivate() const;
59
60 boost::shared_ptr<MetaMethodPrivate> _p;
61
62 MetaMethod(unsigned int uid, const qi::Signature& returnSignature,
63 const std::string& name, const qi::Signature& parametersSignature,
64 const std::string& description, const MetaMethodParameterVector& parameters,
65 const std::string& returnDescription);
66 };
67
68 class MetaMethodBuilderPrivate;
69 class QI_API MetaMethodBuilder {
70 public:
71 MetaMethodBuilder();
72 MetaMethodBuilder(const Signature &sigreturn, const std::string& name, const Signature &signature, const std::string& doc = "");
73 MetaMethodBuilder(const MetaMethodBuilder& other);
74 ~MetaMethodBuilder();
75
76 MetaMethodBuilder& operator= (const MetaMethodBuilder& other);
77
78 std::string name() const;
79
80 void setUid(unsigned int uid);
81 void setSignature(const AnyFunction& f);
82 void setReturnSignature(const Signature &sig);
83 void setName(const std::string& name);
84 void setParametersSignature(const qi::Signature& sig);
85 void setReturnDescription(const std::string& doc);
86 void appendParameter(const std::string& name, const std::string& documentation);
87 void setDescription(const std::string& documentation);
88
89 qi::MetaMethod metaMethod();
90
91 MetaMethodBuilderPrivate* _p;
92 };
93 } // namespace qi
94
95 # ifdef _MSC_VER
96 # pragma warning( pop )
97 # endif
98
99 #endif // _QITYPE_METAMETHOD_HPP_
QI_API
#define QI_API
Definition: api.hpp:33
qi::MetaMethod
Representation of a method in an GenericObject.
Definition: metamethod.hpp:42
qi::MetaMethodBuilder
Definition: metamethod.hpp:69
qi::AnyFunction
Definition: anyfunction.hpp:149
qi::Signature
Definition: signature.hpp:66
api.hpp
dll import/export and compiler message
qi::MetaMethodParameter::_p
MetaMethodParameterPrivate * _p
Definition: metamethod.hpp:36
qi::MetaMethodBuilder::_p
MetaMethodBuilderPrivate * _p
Definition: metamethod.hpp:91
qi::log::env::QI_DEFAULT_LOGHANDLER::name
char const *const name
qi::MetaMethod::_p
boost::shared_ptr< MetaMethodPrivate > _p
Definition: metamethod.hpp:60
typeinterface.hpp
qi::MetaMethodParameterVector
std::vector< MetaMethodParameter > MetaMethodParameterVector
Definition: metamethod.hpp:38
qi::MetaMethodParameter
Definition: metamethod.hpp:24