AP_SerialManager: unify singleton naming to _singleton and get_singleton()

This commit is contained in:
Tom Pittenger 2019-02-09 21:02:55 -08:00 committed by Tom Pittenger
parent 752804c2a5
commit add2130e07
2 changed files with 6 additions and 6 deletions

View File

@ -226,12 +226,12 @@ const AP_Param::GroupInfo AP_SerialManager::var_info[] = {
}; };
// singleton instance // singleton instance
AP_SerialManager *AP_SerialManager::_instance; AP_SerialManager *AP_SerialManager::_singleton;
// Constructor // Constructor
AP_SerialManager::AP_SerialManager() AP_SerialManager::AP_SerialManager()
{ {
_instance = this; _singleton = this;
// setup parameter defaults // setup parameter defaults
AP_Param::setup_object_defaults(this, var_info); AP_Param::setup_object_defaults(this, var_info);
} }
@ -555,7 +555,7 @@ namespace AP {
AP_SerialManager &serialmanager() AP_SerialManager &serialmanager()
{ {
return *AP_SerialManager::get_instance(); return *AP_SerialManager::get_singleton();
} }
} }

View File

@ -109,8 +109,8 @@ public:
}; };
// get singleton instance // get singleton instance
static AP_SerialManager *get_instance(void) { static AP_SerialManager *get_singleton(void) {
return _instance; return _singleton;
} }
// init_console - initialise console at default baud rate // init_console - initialise console at default baud rate
@ -154,7 +154,7 @@ public:
static const struct AP_Param::GroupInfo var_info[]; static const struct AP_Param::GroupInfo var_info[];
private: private:
static AP_SerialManager *_instance; static AP_SerialManager *_singleton;
// array of uart info // array of uart info
struct UARTState { struct UARTState {