Browse Source

AP_InertialSensor: add static create method

mission-4.1.18
Lucas De Marchi 8 years ago committed by Francisco Ferreira
parent
commit
d566567d87
  1. 9
      libraries/AP_InertialSensor/AP_InertialSensor.h

9
libraries/AP_InertialSensor/AP_InertialSensor.h

@ -46,7 +46,13 @@ class AP_InertialSensor : AP_AccelCal_Client
friend class AP_InertialSensor_Backend; friend class AP_InertialSensor_Backend;
public: 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(); static AP_InertialSensor *get_instance();
@ -263,6 +269,7 @@ public:
uint32_t get_last_update_usec(void) const { return _last_update_usec; } uint32_t get_last_update_usec(void) const { return _last_update_usec; }
private: private:
AP_InertialSensor();
// load backend drivers // load backend drivers
bool _add_backend(AP_InertialSensor_Backend *backend); bool _add_backend(AP_InertialSensor_Backend *backend);

Loading…
Cancel
Save