From e32d8ea8b64ad89d301e7dd07c21d10c8386029d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 20 Mar 2018 11:10:16 +0100 Subject: [PATCH] ModuleParams: add setParent() method --- src/platforms/px4_module_params.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/platforms/px4_module_params.h b/src/platforms/px4_module_params.h index 724b5d6826..4ac5fd2a58 100644 --- a/src/platforms/px4_module_params.h +++ b/src/platforms/px4_module_params.h @@ -48,6 +48,15 @@ class ModuleParams : public ListNode public: ModuleParams(ModuleParams *parent) + { + setParent(parent); + } + + /** + * Set the parent module. This is typically not required, only in cases where + * the parent cannot be set via constructor. + */ + void setParent(ModuleParams *parent) { if (parent) { parent->_children.add(this);