mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 06:38:29 -04:00
AP_SerialManager: unify singleton naming to _singleton and get_singleton()
This commit is contained in:
parent
752804c2a5
commit
add2130e07
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user