mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-03-11 17:13:56 -03:00
SITL: unify singleton naming to _singleton and get_singleton()
This commit is contained in:
parent
9e3cf3ad33
commit
a4e91e196f
@ -28,7 +28,7 @@ extern const AP_HAL::HAL& hal;
|
||||
|
||||
namespace SITL {
|
||||
|
||||
SITL *SITL::_s_instance = nullptr;
|
||||
SITL *SITL::_singleton = nullptr;
|
||||
|
||||
// table of user settable parameters
|
||||
const AP_Param::GroupInfo SITL::var_info[] = {
|
||||
@ -254,7 +254,7 @@ namespace AP {
|
||||
|
||||
SITL::SITL *sitl()
|
||||
{
|
||||
return SITL::SITL::get_instance();
|
||||
return SITL::SITL::get_singleton();
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -65,18 +65,18 @@ public:
|
||||
mag_ofs.set(Vector3f(5, 13, -18));
|
||||
AP_Param::setup_object_defaults(this, var_info);
|
||||
AP_Param::setup_object_defaults(this, var_info2);
|
||||
if (_s_instance != nullptr) {
|
||||
if (_singleton != nullptr) {
|
||||
AP_HAL::panic("Too many SITL instances");
|
||||
}
|
||||
_s_instance = this;
|
||||
_singleton = this;
|
||||
}
|
||||
|
||||
/* Do not allow copies */
|
||||
SITL(const SITL &other) = delete;
|
||||
SITL &operator=(const SITL&) = delete;
|
||||
|
||||
static SITL *_s_instance;
|
||||
static SITL *get_instance() { return _s_instance; }
|
||||
static SITL *_singleton;
|
||||
static SITL *get_singleton() { return _singleton; }
|
||||
|
||||
enum GPSType {
|
||||
GPS_TYPE_NONE = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user