From 818c828a4ac8531e35792d672dc33161347e3c50 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Sun, 10 Feb 2019 10:31:01 -0800 Subject: [PATCH] AP_Gripper: unify singleton naming to _singleton and get_singleton() --- libraries/AP_Gripper/AP_Gripper.cpp | 12 ++++++------ libraries/AP_Gripper/AP_Gripper.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/AP_Gripper/AP_Gripper.cpp b/libraries/AP_Gripper/AP_Gripper.cpp index 568302c4a8..bcf6e6b44a 100644 --- a/libraries/AP_Gripper/AP_Gripper.cpp +++ b/libraries/AP_Gripper/AP_Gripper.cpp @@ -70,13 +70,13 @@ const AP_Param::GroupInfo AP_Gripper::var_info[] = { AP_Gripper::AP_Gripper() { - if (_s_instance) { + if (_singleton) { #if CONFIG_HAL_BOARD == HAL_BOARD_SITL AP_HAL::panic("Too many grippers"); #endif return; } - _s_instance = this; + _singleton = this; AP_Param::setup_object_defaults(this, var_info); } @@ -84,10 +84,10 @@ AP_Gripper::AP_Gripper() /* * Get the AP_Gripper singleton */ -AP_Gripper *AP_Gripper::_s_instance = nullptr; -AP_Gripper *AP_Gripper::get_instance() +AP_Gripper *AP_Gripper::_singleton = nullptr; +AP_Gripper *AP_Gripper::get_singleton() { - return _s_instance; + return _singleton; } void AP_Gripper::init() @@ -155,7 +155,7 @@ namespace AP { AP_Gripper *gripper() { - return AP_Gripper::get_instance(); + return AP_Gripper::get_singleton(); } }; diff --git a/libraries/AP_Gripper/AP_Gripper.h b/libraries/AP_Gripper/AP_Gripper.h index 8db9a521ba..0a5b7dd54b 100644 --- a/libraries/AP_Gripper/AP_Gripper.h +++ b/libraries/AP_Gripper/AP_Gripper.h @@ -26,8 +26,8 @@ public: AP_Gripper(const AP_Gripper &other) = delete; AP_Gripper &operator=(const AP_Gripper&) = delete; - static AP_Gripper *get_instance(); - static AP_Gripper *_s_instance; + static AP_Gripper *get_singleton(); + static AP_Gripper *_singleton; // indicate whether this module is enabled or not bool enabled() const { return _enabled; }