diff --git a/docs/general/04_detail_module_concept.rst b/docs/general/04_detail_module_concept.rst index a52622a4..b25cdc1b 100644 --- a/docs/general/04_detail_module_concept.rst +++ b/docs/general/04_detail_module_concept.rst @@ -377,6 +377,8 @@ Focusing on the source and header files, generally, the tool generates: * One source-header pair describing a class for each interface implementation in the module: ``${IMPLEMENTATION_ID}/${INTERFACE_NAME}Impl.{cpp, hpp}`` +.. _moduleconcept_modclass: + The module class ---------------- @@ -399,7 +401,10 @@ a few notable members: - reference to the interface implementation; * For each interface requirement: ``std::unique_ptr<${INTERFACE_ID}Intf> r_${REQUIREMENT_ID}`` - use this to - trigger commands or subscribe to variables on the provider. + trigger commands or subscribe to variables on the provider. If 1 is used + for ``min_connections`` and ``max_connections`` in ``required`` in the module's + manifest a pointer is given as an argument as shown, otherwise it's an + array (std::vector) of pointers. The header file contains designated areas where further members or other definitions can be added. diff --git a/docs/tutorials/new_modules/index.rst b/docs/tutorials/new_modules/index.rst index 9a24f013..aa94c3bb 100644 --- a/docs/tutorials/new_modules/index.rst +++ b/docs/tutorials/new_modules/index.rst @@ -110,6 +110,15 @@ command `command_tutorial` that can be called by another module and will just always return the string "everest" as result. We will later give some ideas how to extend this minimal example. +In C++, the interface is an object class that wraps the publish and +subscribe of the MQTT topics of the interface. + +The MQTT topics of an interface are either commands or variables. +It comes in two forms, depending on if you are using it or implementing it. + +- Implementation handles commands and publishes variables. +- Interface offer subscribing to variables and invokes commands. + We store the following interface configuration in form of a .yaml file in `$EVEREST_TUTORIAL_DIR/interfaces/interface_tutorial_module.yaml`: @@ -238,6 +247,11 @@ its interface implementations. Among others, you'll furthermore find the module's configuration and a pointer to the interface implementations. +Note: After you have built on your module's autogenerated code, you may well +find you need to change the manifest but don't want to regenerate these files. +Changing the manifest may change the arguments your modules contructor is +called with by other auto generated code, so you have to know how to change +it. Please refer to the :ref:`the module class in the module concept `. **interface_impl_tutorial_module/interface_tutorial_moduleImpl{.hpp,.cpp}:** For each interface implementation (here, only a single one is defined), the