Skip to content

Commit

Permalink
AP_Notify: unify singleton naming to _singleton and get_singleton()
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Feb 11, 2019
1 parent 8a6a39b commit 4ece7fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libraries/AP_Notify/AP_Notify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions libraries/AP_Notify/AP_Notify.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class AP_Notify
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
Expand Down Expand Up @@ -154,7 +154,7 @@ class AP_Notify

private:

static AP_Notify *_instance;
static AP_Notify *_singleton;

void add_backend_helper(NotifyDevice *backend);

Expand Down

0 comments on commit 4ece7fd

Please sign in to comment.