From d3ebaa37fa9d06ca60017d9bc6dc213518cc1fc9 Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Mon, 2 Oct 2023 09:21:21 -0500 Subject: [PATCH] Update composite instruction user data to align with gazebo user data variant --- .../composite_instruction.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tesseract_command_language/include/tesseract_command_language/composite_instruction.h b/tesseract_command_language/include/tesseract_command_language/composite_instruction.h index 268a98d4a44..859d20beb04 100644 --- a/tesseract_command_language/include/tesseract_command_language/composite_instruction.h +++ b/tesseract_command_language/include/tesseract_command_language/composite_instruction.h @@ -71,8 +71,17 @@ class CompositeInstruction EIGEN_MAKE_ALIGNED_OPERATOR_NEW // LCOV_EXCL_STOP - /** User Data */ - using UserDataVariant = std::variant; + /** + * @brief Alias for a variant that can hold various types of data. + * @details The first type of the variant is std::monostate in order to prevent + * default-constructed variants from holding a type (a default-constructed + * variant is returned when a user calls CompositeInstruction::UserData with a key that + * doesn't exist for the CompositeInstruction. In this case, since the key doesn't + * exist, the variant that is returned shouldn't hold any types - an + * "empty variant" should be returned for keys that don't exist) + */ + using UserDataVariant = + std::variant; using UserData = std::unordered_map; /** value_type */