AC_Sprayer: unify singleton naming to _singleton and get_singleton()

This commit is contained in:
Tom Pittenger 2019-02-10 10:34:16 -08:00 committed by Tom Pittenger
parent c10fd9cafb
commit edc8ccace6
2 changed files with 8 additions and 8 deletions

View File

@ -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();
}
};

View File

@ -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);