- 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
typeobject.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_TYPEOBJECT_HPP_
8 #define _QI_TYPE_TYPEOBJECT_HPP_
9
10 #include <limits>
11 #include <cstdint>
12
13 #include <qi/type/metaobject.hpp>
14 #include <qi/future.hpp>
15 #include <qi/anyfunction.hpp>
16 #include <qi/os.hpp>
17 #include <qi/objectuid.hpp>
18
19 namespace qi {
20
24 enum MetaCallType {
26 MetaCallType_Auto = 0,
28 MetaCallType_Direct = 1,
30 MetaCallType_Queued = 2,
31 };
32 class SignalSubscriber;
33 class Manageable;
34 using SignalLink = qi::uint64_t;
35
36 /* We will have 2 implementations for 2 classes of C++ class:
37 * - DynamicObject: Use DynamicObjectBuilder
38 * - T: Use ObjectTypeBuilder
39 *
40 * All values of this type (GenericObject) will be handled
41 *
42 *
43 * NOTE: no SignalBase accessor at this point, but the backend is such that it would be possible
44 * but if we do that, virtual emit/connect/disconnect must go away, as they could be bypassed
45 * ->RemoteObject, ALBridge will have to adapt
46 *
47 */
48 class QI_API ObjectTypeInterface: public TypeInterface
49 {
50 public:
51 virtual const MetaObject& metaObject(void* instance) = 0;
52 virtual ObjectUid uid(void* instance) const = 0;
53 virtual qi::Future<AnyReference> metaCall(void* instance, AnyObject context, unsigned int method, const GenericFunctionParameters& params, MetaCallType callType = MetaCallType_Auto, Signature returnSig = Signature())=0;
54 virtual void metaPost(void* instance, AnyObject context, unsigned int signal, const GenericFunctionParameters& params)=0;
55 virtual qi::Future<SignalLink> connect(void* instance, AnyObject context, unsigned int event, const SignalSubscriber& subscriber)=0;
57 virtual qi::Future<void> disconnect(void* instance, AnyObject context, SignalLink linkId)=0;
59 virtual const std::vector<std::pair<TypeInterface*, std::ptrdiff_t> >& parentTypes() = 0;
60 virtual qi::Future<AnyValue> property(void* instance, AnyObject context, unsigned int id) = 0;
61 virtual qi::Future<void> setProperty(void* instance, AnyObject context, unsigned int id, AnyValue value) = 0;
62 virtual TypeKind kind() { return TypeKind_Object;}
63 static const auto INHERITS_FAILED = PTRDIFF_MAX;
64
66 std::ptrdiff_t inherits(TypeInterface* other);
67 };
68
69 }
70
71 #endif // _QITYPE_TYPEOBJECT_HPP_
qi::AnyValue
Definition: anyvalue.hpp:19
qi::GenericFunctionParameters
Definition: anyfunction.hpp:266
QI_API
#define QI_API
Definition: api.hpp:33
objectuid.hpp
qi::metaCall
qi::Future< AnyReference > metaCall(ExecutionContext *ec, ObjectThreadingModel objectThreadingModel, MetaCallType methodThreadingModel, MetaCallType callType, AnyObject manageable, unsigned int methodId, AnyFunction func, const GenericFunctionParameters &params, bool noCloneFirst=false, unsigned int callerId=0, qi::os::timeval postTimestamp=qi::os::timeval())
qi::Future
Definition: executioncontext.hpp:20
os.hpp
metaobject.hpp
qi::Signature
Definition: signature.hpp:66
qi::MetaCallType_Auto
Honor the default behavior.
Definition: typeobject.hpp:26
qi::TypeInterface
Definition: typeinterface.hpp:129
qi::TypeKind_Object
Definition: fwd.hpp:63
qi::MetaCallType_Direct
Force a synchronous call.
Definition: typeobject.hpp:28
future.hpp
qi::ObjectTypeInterface
Definition: typeobject.hpp:48
qi::MetaCallType
MetaCallType
Definition: typeobject.hpp:24
qi::Object< Empty >
PTRDIFF_MAX
#define PTRDIFF_MAX
Definition: os.hpp:56
qi::TypeKind
TypeKind
Definition: fwd.hpp:54
qi::ObjectTypeInterface::kind
virtual TypeKind kind()
Definition: typeobject.hpp:62
qi::SignalLink
qi::uint64_t SignalLink
Definition: signal.hpp:36
qi::MetaCallType_Queued
Force an asynchronous call in an other thread.
Definition: typeobject.hpp:30
anyfunction.hpp
qi::uint64_t
uint64_t uint64_t
Definition: types.hpp:66
qi::PtrUid
Definition: ptruid.hpp:33
qi::log::context
int context()
Get log context.
qi::MetaObject
Description of the signals and methods accessible on an ObjectTypeInterface.
Definition: metaobject.hpp:25