libkovan  1
The kovan standard library
reflection.hpp
Go to the documentation of this file.
1 #ifndef _REFLECTION_HPP_
2 #define _REFLECTION_HPP_
3 /*
4 struct ReflectionVariant
5 {
6  enum Type {
7  Void,
8  SignedChar,
9  UnsignedChar,
10  SignedShort,
11  UnsignedShort,
12  SignedInteger,
13  UnsignedInteger,
14  SignedLong,
15  UnsignedLong,
16  Double,
17  Float,
18  Bool,
19  SignedCharArray,
20  UnsignedCharArray,
21  SignedShortArray,
22  UnsignedShortArray,
23  SignedIntegerArray,
24  UnsignedIntegerArray,
25  SignedLongArray,
26  UnsignedLongArray
27  } type;
28  unsigned int size;
29 
30  union {
31  signed char signedCharValue;
32  unsigned char unsignedCharValue;
33 
34  signed short signedShortValue;
35  unsigned short unsignedShortValue;
36 
37  signed int signedIntegerValue;
38  unsigned int unsignedIntegerValue;
39 
40  signed long signedLongValue;
41  unsigned long unsignedLongValue;
42 
43  double doubleValue;
44  float floatValue;
45 
46  bool boolValue;
47 
48  signed char *signedCharArrayValue;
49  unsigned char *unsignedCharArrayValue;
50 
51  signed short *signedShortArrayValue;
52  unsigned short *unsignedShortArrayValue;
53 
54  signed int *signedIntegerArrayValue;
55  unsigned int *unsignedIntegerArrayValue;
56 
57  signed long *signedLongArrayValue;
58  unsigned long *unsignedLongArrayValue;
59  };
60 };
61 
62 typedef std::vector<ReflectionVariant> ReflectionVariantVector;
63 
64 class ReflectionDelegate
65 {
66 public:
67  ReflectionVariant call(const std::string& method, const ReflectionVariantVector& parameters);
68 };
69 
70 class ReflectionEngine
71 {
72 public:
73  ReflectionVariant interpret(const std::string& command);
74 
75  void reset();
76 
77  static ReflectionEngine *instance();
78 private:
79  ReflectionEngine();
80  ReflectionEngine(const ReflectionEngine& rhs);
81  ReflectionEngine& operator=(const ReflectionEngine& rhs);
82 
83  std::map<std::string, ReflectionVariant> m_variables;
84 };
85 */
86 #endif