AP_Baro: add static create method

This commit is contained in:
Lucas De Marchi 2017-08-08 00:43:16 -07:00 committed by Francisco Ferreira
parent c34104b369
commit c5c1d5abfe

View File

@ -24,8 +24,13 @@ class AP_Baro
friend class AP_Baro_SITL; // for access to sensors[]
public:
// constructor
AP_Baro();
static AP_Baro create() { return AP_Baro{}; }
constexpr AP_Baro(AP_Baro &&other) = default;
/* Do not allow copies */
AP_Baro(const AP_Baro &other) = delete;
AP_Baro &operator=(const AP_Baro&) = delete;
// barometer types
typedef enum {
@ -161,6 +166,8 @@ public:
void set_pressure_correction(uint8_t instance, float p_correction);
private:
AP_Baro();
// how many drivers do we have?
uint8_t _num_drivers;
AP_Baro_Backend *drivers[BARO_MAX_DRIVERS];