dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
uavobjecttemplate.h
Go to the documentation of this file.
1 
19 /*
20  * This program is free software; you can redistribute it and/or modify
21  * it under the terms of the GNU General Public License as published by
22  * the Free Software Foundation; either version 3 of the License, or
23  * (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful, but
26  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
27  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
28  * for more details.
29  *
30  * You should have received a copy of the GNU General Public License along
31  * with this program; if not, see <http://www.gnu.org/licenses/>
32  */
33 #ifndef $(NAMEUC)_H
34 #define $(NAMEUC)_H
35 
38 
39 #include "uavogcsversion.h"
40 
41 $(PARENT_INCLUDES)
42 
43 class UAVOBJECTS_EXPORT $(NAME): public UAVDataObject
44 {
45  Q_OBJECT
46 $(PROPERTIES)
47 $(ENUMS)
48 
49 public:
50  // Field structure
51 #ifdef _MSC_VER
52 #pragma pack(push, 1)
53 __declspec(align(4)) typedef struct {
54 $(DATAFIELDS)
55  } DataFields;
56 #pragma pack(pop)
57 #else
58  typedef struct {
59 $(DATAFIELDS)
60  } __attribute__((packed)) __attribute__((aligned(4))) DataFields;
61 #endif
62  // Field information
63 $(DATAFIELDINFO)
64 
65  // Constants
66  static const quint32 OBJID = $(OBJIDHEX);
67  static const QString NAME;
68  static const QString DESCRIPTION;
69  static const bool ISSINGLEINST = $(ISSINGLEINST);
70  static const bool ISSETTINGS = $(ISSETTINGS);
71  static const quint32 NUMBYTES = $(NUMBYTES);
72  static const QHash<QString, QString> FIELD_DESCRIPTIONS;
73 
74  // Functions
75  $(NAME)();
76 
77  DataFields getData();
78  void setData(const DataFields& data);
79  Metadata getDefaultMetadata();
80  UAVDataObject* clone(quint32 instID);
82 
83  static $(NAME)* GetInstance(UAVObjectManager* objMngr, quint32 instID = 0);
84  static qint32 getNumInstances(UAVObjectManager* objMngr) {return objMngr->getNumInstances(OBJID);}
85 
86 $(PROPERTY_GETTERS)
87 
88 public slots:
89 $(PROPERTY_SETTERS)
90 
91 signals:
92 $(PROPERTY_NOTIFICATIONS)
93 
94 private slots:
95  void emitNotifications();
96 
97 private:
98  DataFields data;
99 
100  void setDefaultFieldValues();
101 
102 };
103 
104 #endif // $(NAMEUC)_H
Metadata getDefaultMetadata()
DataFields getData()
__attribute__((packed))
UAVDataObject * dirtyClone()
DataFields data
() NAME()
void setData(const DataFields &data)
const QString(NAME) const QString(NAME) const QHash< QString, QString >(NAME)
UAVDataObject * clone(quint32 instID)
qint32 getNumInstances(const QString &name)