SkyPulse UAV V0.1
Loading...
Searching...
No Matches
DataHandlerFactory.h
Go to the documentation of this file.
1#ifndef DATAHANDLERFACTORY_H
2#define DATAHANDLERFACTORY_H
3
4#include "DataHandler.h"
5#include "handler_bmp180.h"
6
8public:
9 static DataHandler* createHandler(const QByteArray &data, MediatorInterface* mediator) {
10 if (data.isEmpty()) return nullptr;
11
12 DataHandler* handler = nullptr;
13 switch (static_cast<unsigned char>(data[0])) {
14 case 0x15:
15 return new Handler_BMP180(mediator);
16 case 0x02:
17
18 default:
19 return nullptr;
20 }
21 }
22};
23
24#endif // DATAHANDLERFACTORY_H
Definition DataHandlerFactory.h:7
static DataHandler * createHandler(const QByteArray &data, MediatorInterface *mediator)
Definition DataHandlerFactory.h:9
Definition DataHandler.h:6
Definition handler_bmp180.h:9
Definition MediatorInterface.h:6