AP_Rally: add static create method

This commit is contained in:
Lucas De Marchi 2017-08-29 16:19:58 -07:00 committed by Francisco Ferreira
parent c6eb48009b
commit 2f2abc2924

View File

@ -35,9 +35,16 @@ struct PACKED RallyLocation {
/// @class AP_Rally
/// @brief Object managing Rally Points
class AP_Rally {
public:
AP_Rally(AP_AHRS &ahrs);
static AP_Rally create(AP_AHRS &ahrs) {
return AP_Rally{ahrs};
}
constexpr AP_Rally(AP_Rally &&other) = default;
/* Do not allow copies */
AP_Rally(const AP_Rally &other) = delete;
AP_Rally &operator=(const AP_Rally&) = delete;
// data handling
bool get_rally_point_with_index(uint8_t i, RallyLocation &ret) const;
@ -59,6 +66,9 @@ public:
// parameter block
static const struct AP_Param::GroupInfo var_info[];
protected:
AP_Rally(AP_AHRS &ahrs);
private:
virtual bool is_valid(const Location &rally_point) const { return true; }