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