AP_Baro: unify singleton naming to _singleton and get_singleton()

This commit is contained in:
Tom Pittenger 2019-02-10 10:33:05 -08:00 committed by Tom Pittenger
parent 0f311ba04f
commit 52887e1c45
2 changed files with 7 additions and 7 deletions

View File

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

View File

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