XORDE  v1.0
eXtensible Operational Robotic Development Environment
objectdescription.h
1 #ifndef OBJECTDESCRIPTION_H
2 #define OBJECTDESCRIPTION_H
3 
4 #include "tronostools_global.h"
5 #include <QString>
6 #include <QByteArray>
7 
8 #pragma pack(push,1)
9 
13 {
14  unsigned char id;
15  unsigned char flags;
16  unsigned char rType;
17  unsigned char wType;
18  unsigned char readSize;
19  unsigned char writeSize;
20 };
21 
25 {
26 public:
27  unsigned char id;
28  unsigned char version: 4;
29  unsigned char _verid: 4;
30  unsigned char group;
31  unsigned char _reserve;
32  unsigned char flags;
33  unsigned short extFlags;
34  unsigned char rType;
35  unsigned char wType;
36  unsigned short readSize;
37  unsigned short writeSize;
38 
40 };
41 
44 class TRONOSTOOLSSHARED_EXPORT ObjectDescription : public ObjectDescriptionHeaderV2
45 {
46 private:
47  inline unsigned char swapRWflags(unsigned char f) {return (f & 0xF9) | ((f & 2) << 1) | ((f & 4) >> 1);}
48 
51  bool parse(const QByteArray &ba);
52 
53 public:
55  QString name;
56 
58  explicit ObjectDescription();
59 
61  ObjectDescription(const QByteArray &ba);
62 
65  inline bool isValid() const {return flags;} // valid object must have at least one flag set
66 
68  QString flagString() const;
69 
72  void read(QByteArray &ba) const;
73 };
74 #pragma pack(pop)
75 
76 #endif // OBJECTDESCRIPTION_H
unsigned char wType
Type of the object to write (Type enum)
Definition: objectdescription.h:35
ONB Object description.
Definition: objectdescription.h:44
unsigned char group
Object ID category.
Definition: objectdescription.h:30
bool isValid() const
Test Object descriptor for validity.
Definition: objectdescription.h:65
unsigned char flags
Access flags from Flags enum.
Definition: objectdescription.h:32
ONB Object description header, version 2.
Definition: objectdescription.h:24
unsigned short extFlags
Advanced flags (min max def) from ExtFlags enum.
Definition: objectdescription.h:33
unsigned char wType
Type of the object to write (Type enum)
Definition: objectdescription.h:17
ONB Object description header.
Definition: objectdescription.h:12
unsigned char writeSize
Size of the object to write in bytes.
Definition: objectdescription.h:19
unsigned char rType
Type of the object to read (Type enum)
Definition: objectdescription.h:34
unsigned char rType
Type of the object to read (Type enum)
Definition: objectdescription.h:16
unsigned short writeSize
Size of the object to write in bytes.
Definition: objectdescription.h:37
unsigned char readSize
Size of the object to read in bytes.
Definition: objectdescription.h:18
unsigned short readSize
Size of the object to read in bytes.
Definition: objectdescription.h:36
QString name
Name of the object.
Definition: objectdescription.h:55
unsigned char _reserve
Not used, reserved for future.
Definition: objectdescription.h:31
unsigned char id
Object ID.
Definition: objectdescription.h:27
unsigned char flags
Access flags from Flags enum.
Definition: objectdescription.h:15
unsigned char version
Version of the descriptor (current version = 2)
Definition: objectdescription.h:28
unsigned char id
Object ID.
Definition: objectdescription.h:14
unsigned char _verid
Distinction of descriptor version >= 2 (must be equal to 0xF)
Definition: objectdescription.h:29