From edc8ccace63d3740a242d203a7342824468985a9 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Sun, 10 Feb 2019 10:34:16 -0800 Subject: [PATCH] AC_Sprayer: unify singleton naming to _singleton and get_singleton() --- libraries/AC_Sprayer/AC_Sprayer.cpp | 12 ++++++------ libraries/AC_Sprayer/AC_Sprayer.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/AC_Sprayer/AC_Sprayer.cpp b/libraries/AC_Sprayer/AC_Sprayer.cpp index c472462a3e..0651dc2b54 100644 --- a/libraries/AC_Sprayer/AC_Sprayer.cpp +++ b/libraries/AC_Sprayer/AC_Sprayer.cpp @@ -50,13 +50,13 @@ const AP_Param::GroupInfo AC_Sprayer::var_info[] = { AC_Sprayer::AC_Sprayer() { - if (_s_instance) { + if (_singleton) { #if CONFIG_HAL_BOARD == HAL_BOARD_SITL AP_HAL::panic("Too many sprayers"); #endif return; } - _s_instance = this; + _singleton = this; AP_Param::setup_object_defaults(this, var_info); @@ -74,10 +74,10 @@ AC_Sprayer::AC_Sprayer() /* * Get the AP_Sprayer singleton */ -AC_Sprayer *AC_Sprayer::_s_instance = nullptr; -AC_Sprayer *AC_Sprayer::get_instance() +AC_Sprayer *AC_Sprayer::_singleton; +AC_Sprayer *AC_Sprayer::get_singleton() { - return _s_instance; + return _singleton; } void AC_Sprayer::run(const bool true_false) @@ -190,7 +190,7 @@ namespace AP { AC_Sprayer *sprayer() { - return AC_Sprayer::get_instance(); + return AC_Sprayer::get_singleton(); } }; diff --git a/libraries/AC_Sprayer/AC_Sprayer.h b/libraries/AC_Sprayer/AC_Sprayer.h index 6f606e548f..b423594639 100644 --- a/libraries/AC_Sprayer/AC_Sprayer.h +++ b/libraries/AC_Sprayer/AC_Sprayer.h @@ -38,8 +38,8 @@ public: AC_Sprayer(const AC_Sprayer &other) = delete; AC_Sprayer &operator=(const AC_Sprayer&) = delete; - static AC_Sprayer *get_instance(); - static AC_Sprayer *_s_instance; + static AC_Sprayer *get_singleton(); + static AC_Sprayer *_singleton; /// run - allow or disallow spraying to occur void run(bool true_false);