Free Electron
Signature.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __signal_Signature_h__
8 #define __signal_Signature_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 typedef Array<Instance> t_arglist;
16 
17 /** @ brief Defines a call argument signature for DispatchI
18 
19  @ingroup signal
20  */
21 class FE_DL_EXPORT Signature
22 {
23  public:
24  class ArgSpec
25  {
26  public:
27  sp<BaseType> m_spType;
28  Instance m_instance; // for exact match
29  };
30 
31  Signature(void);
32  Signature(const Signature &other);
33  Signature &operator=(const Signature &other);
34 virtual ~Signature(void);
35 virtual bool match(t_arglist a_argv);
36 virtual void append(sp<BaseType> a_type);
37 virtual void append(sp<BaseType> a_type, Instance a_value);
38  template <class T>
39  void append(sp<TypeMaster> a_spTM, T *a_value);
40 
42  &argspecs(void);
43 
44  private:
45  Array<ArgSpec> m_argSpecs;
46 };
47 
48 template<class T>
49 void Signature::append(sp<TypeMaster> a_spTM, T *a_value)
50 {
51  sp<BaseType> spBT;
52  spBT = a_spTM->lookupType(TypeInfo(getTypeId<T>()));
53  Instance instance(reinterpret_cast<void *>(a_value), spBT, NULL);
54  append(spBT, instance);
55 }
56 
57 } /* namespace ext */
58 } /* namespace fe */
59 
60 #endif /* __signal_Signature_h__ */
61 
Smart pointer used with types represented by BaseType.
Definition: Instance.h:28
kernel
Definition: namespace.dox:3
C++ type_info wrapper.
Definition: Type.h:20
Intrusive Smart Pointer.
Definition: src/core/ptr.h:53
@ brief Defines a call argument signature for DispatchI
Definition: Signature.h:21