SITL: unify singleton naming to _singleton and get_singleton()

This commit is contained in:
Tom Pittenger 2019-02-09 21:01:19 -08:00 committed by Tom Pittenger
parent 9e3cf3ad33
commit a4e91e196f
2 changed files with 6 additions and 6 deletions

View File

@ -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();
}
};

View File

@ -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,