AP_InertialSensor: add static create method

This commit is contained in:
Lucas De Marchi 2017-08-08 08:17:57 -07:00 committed by Francisco Ferreira
parent c1a957fbf3
commit d566567d87

View File

@ -46,7 +46,13 @@ class AP_InertialSensor : AP_AccelCal_Client
friend class AP_InertialSensor_Backend;
public:
AP_InertialSensor();
static AP_InertialSensor create() { return AP_InertialSensor{}; }
constexpr AP_InertialSensor(AP_InertialSensor &&other) = default;
/* Do not allow copies */
AP_InertialSensor(const AP_InertialSensor &other) = delete;
AP_InertialSensor &operator=(const AP_InertialSensor&) = delete;
static AP_InertialSensor *get_instance();
@ -263,6 +269,7 @@ public:
uint32_t get_last_update_usec(void) const { return _last_update_usec; }
private:
AP_InertialSensor();
// load backend drivers
bool _add_backend(AP_InertialSensor_Backend *backend);