~aleteoryx/muditaos

fa471405d1cf86bd077237c9fe8a80a603434334 — Marcin Smoczyński 5 years ago d070d69
[EGD-3461] sys: update service header comments (#774)

Remove TODOs, update Deinit/Close handlers doxygen comments.

Make CloseHandler final - it must not be overloaded.
1 files changed, 10 insertions(+), 6 deletions(-)

M module-sys/Service/Service.hpp
M module-sys/Service/Service.hpp => module-sys/Service/Service.hpp +10 -6
@@ 31,10 31,6 @@ namespace sys
    class Service : public cpp_freertos::Thread, public std::enable_shared_from_this<Service>
    {
      public:
        /// TODO this should be split in two...
        /// only ServiceManager should be able to not tell who is it's parent :/
        /// parent ... should be (sharet) pointer at least.. (to be able to tell if parent exists (shared) and to
        /// identify parent nicelly)
        Service(std::string name,
                std::string parent       = "",
                uint32_t stackDepth      = 4096,


@@ 51,12 47,20 @@ namespace sys
        // Invoked during initialization
        virtual ReturnCodes InitHandler() = 0;

        // Invoked upon receiving close request
        /**
         * @brief Handler to gently release system resources, such as worker
         * threads. All other resources should be freed in a destructor.
         *
         * @return ReturnCodes
         */
        virtual ReturnCodes DeinitHandler() = 0;

        virtual ReturnCodes SwitchPowerModeHandler(const ServicePowerMode mode) = 0;

        void CloseHandler();
        /**
         * @brief Ends stops service's thread and its timers.
         */
        virtual void CloseHandler() final;

        std::string parent;