libqi-api  release-2.5.3-2016-11-18
 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 
12 #include <qi/type/metaobject.hpp>
13 #include <qi/future.hpp>
14 #include <qi/anyfunction.hpp>
15 
16 namespace qi {
17 
21  enum MetaCallType {
28  };
29  class SignalSubscriber;
30  class Manageable;
31  using SignalLink = qi::uint64_t;
32 
33  /* We will have 2 implementations for 2 classes of C++ class:
34  * - DynamicObject: Use DynamicObjectBuilder
35  * - T: Use ObjectTypeBuilder
36  *
37  * All values of this type (GenericObject) will be handled
38  *
39  *
40  * NOTE: no SignalBase accessor at this point, but the backend is such that it would be possible
41  * but if we do that, virtual emit/connect/disconnect must go away, as they could be bypassed
42  * ->RemoteObject, ALBridge will have to adapt
43  *
44  */
46  {
47  public:
48  virtual const MetaObject& metaObject(void* instance) = 0;
49  virtual qi::Future<AnyReference> metaCall(void* instance, AnyObject context, unsigned int method, const GenericFunctionParameters& params, MetaCallType callType = MetaCallType_Auto, Signature returnSig = Signature())=0;
50  virtual void metaPost(void* instance, AnyObject context, unsigned int signal, const GenericFunctionParameters& params)=0;
51  virtual qi::Future<SignalLink> connect(void* instance, AnyObject context, unsigned int event, const SignalSubscriber& subscriber)=0;
53  virtual qi::Future<void> disconnect(void* instance, AnyObject context, SignalLink linkId)=0;
55  virtual const std::vector<std::pair<TypeInterface*, int> >& parentTypes() = 0;
56  virtual qi::Future<AnyValue> property(void* instance, AnyObject context, unsigned int id) = 0;
57  virtual qi::Future<void> setProperty(void* instance, AnyObject context, unsigned int id, AnyValue value) = 0;
58  virtual TypeKind kind() { return TypeKind_Object;}
59 
60  static const int INHERITS_FAILED = INT_MIN;
61 
63  int inherits(TypeInterface* other);
64  };
65 
66 }
67 
68 #endif // _QITYPE_TYPEOBJECT_HPP_
#define QI_API
Definition: api.hpp:33
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())
Honor the default behavior.
Definition: typeobject.hpp:23
Force a synchronous call.
Definition: typeobject.hpp:25
MetaCallType
Definition: typeobject.hpp:21
TypeKind
Definition: fwd.hpp:53
virtual TypeKind kind()
Definition: typeobject.hpp:58
qi::uint64_t SignalLink
Definition: signal.hpp:35
Force an asynchronous call in an other thread.
Definition: typeobject.hpp:27
uint64_t uint64_t
Definition: types.hpp:66
int context()
Get log context.
Description of the signals and methods accessible on an ObjectTypeInterface.
Definition: metaobject.hpp:25