Browse Source

AP_Notify: unify singleton naming to _singleton and get_singleton()

master
Tom Pittenger 6 years ago committed by Tom Pittenger
parent
commit
4ece7fd4f0
  1. 6
      libraries/AP_Notify/AP_Notify.cpp
  2. 6
      libraries/AP_Notify/AP_Notify.h

6
libraries/AP_Notify/AP_Notify.cpp

@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
extern const AP_HAL::HAL& hal;
AP_Notify *AP_Notify::_instance;
AP_Notify *AP_Notify::_singleton;
#define CONFIG_NOTIFY_DEVICES_MAX 6
@ -154,10 +154,10 @@ const AP_Param::GroupInfo AP_Notify::var_info[] = { @@ -154,10 +154,10 @@ const AP_Param::GroupInfo AP_Notify::var_info[] = {
AP_Notify::AP_Notify()
{
AP_Param::setup_object_defaults(this, var_info);
if (_instance != nullptr) {
if (_singleton != nullptr) {
AP_HAL::panic("AP_Notify must be singleton");
}
_instance = this;
_singleton = this;
}
// static flags, to allow for direct class update from device drivers

6
libraries/AP_Notify/AP_Notify.h

@ -47,8 +47,8 @@ public: @@ -47,8 +47,8 @@ public:
AP_Notify &operator=(const AP_Notify&) = delete;
// get singleton instance
static AP_Notify *instance(void) {
return _instance;
static AP_Notify *get_singleton(void) {
return _singleton;
}
// Oreo LED Themes
@ -154,7 +154,7 @@ public: @@ -154,7 +154,7 @@ public:
private:
static AP_Notify *_instance;
static AP_Notify *_singleton;
void add_backend_helper(NotifyDevice *backend);

Loading…
Cancel
Save