05Robot 3.0

- Main Page
- Modules
- Classes
- Files

- File List
- File Members

common.h
Go to the documentation of this file.
1
7 #ifndef COMMON_H
8 #define COMMON_H
9 #if defined(MYSHAREDLIB_LIBRARY)
10 # define MYSHAREDLIB_EXPORT Q_DECL_EXPORT
11 #else
12 # define MYSHAREDLIB_EXPORT Q_DECL_IMPORT
13 #endif
14 #define ADD_PROPERTY(member, _type) \
15 public: \
16 \
20 void Set##member(_type _arg_##member) \
21 { \
22 m_##member = _arg_##member;\
23 } \
24 \
28 _type member() const\
29 { \
30 return m_##member;\
31 } \
32 private: \
33 _type m_##member; \
34 Q_PROPERTY(_type member READ member WRITE Set##member DESIGNABLE true USER true) \
35 public:
36
37 #define ADD_STREAM(member, _type) \
38 public: \
39 \
43 int member##_IsEmpty() \
44 { \
45 return m_##member.isEmpty();\
46 } \
47 \
51 void member##_Enqueue(_type t)\
52 { \
53 m_##member##.enqueue(t);\
54 } \
55 _type member##_Dequeue() const\
56 { \
57 return m_##member.dequeue();\
58 } \
59 private: \
60 QQueue<_type> m_##member;
61 #endif // COMMON_H