Browse Source

AP_Baro: unify singleton naming to _singleton and get_singleton()

mission-4.1.18
Tom Pittenger 6 years ago committed by Tom Pittenger
parent
commit
52887e1c45
  1. 8
      libraries/AP_Baro/AP_Baro.cpp
  2. 6
      libraries/AP_Baro/AP_Baro.h

8
libraries/AP_Baro/AP_Baro.cpp

@ -165,14 +165,14 @@ const AP_Param::GroupInfo AP_Baro::var_info[] = { @@ -165,14 +165,14 @@ const AP_Param::GroupInfo AP_Baro::var_info[] = {
};
// singleton instance
AP_Baro *AP_Baro::_instance;
AP_Baro *AP_Baro::_singleton;
/*
AP_Baro constructor
*/
AP_Baro::AP_Baro()
{
_instance = this;
_singleton = this;
AP_Param::setup_object_defaults(this, var_info);
}
@ -707,7 +707,7 @@ void AP_Baro::_probe_i2c_barometers(void) @@ -707,7 +707,7 @@ void AP_Baro::_probe_i2c_barometers(void)
bool AP_Baro::should_df_log() const
{
AP_Logger *instance = AP_Logger::instance();
AP_Logger *instance = AP_Logger::get_singleton();
if (instance == nullptr) {
return false;
}
@ -841,7 +841,7 @@ namespace AP { @@ -841,7 +841,7 @@ namespace AP {
AP_Baro &baro()
{
return *AP_Baro::get_instance();
return *AP_Baro::get_singleton();
}
};

6
libraries/AP_Baro/AP_Baro.h

@ -31,8 +31,8 @@ public: @@ -31,8 +31,8 @@ public:
AP_Baro &operator=(const AP_Baro&) = delete;
// get singleton
static AP_Baro *get_instance(void) {
return _instance;
static AP_Baro *get_singleton(void) {
return _singleton;
}
// barometer types
@ -183,7 +183,7 @@ public: @@ -183,7 +183,7 @@ public:
private:
// singleton
static AP_Baro *_instance;
static AP_Baro *_singleton;
// how many drivers do we have?
uint8_t _num_drivers;

Loading…
Cancel
Save