LCOV - code coverage report
Current view: top level - muse/framework/rcommand - commandable.h Coverage Total Hit
Test: filtered_coverage.info Lines: 70.0 % 10 7
Test Date: 2026-11-05 04:07:02

            Line data    Source code
       1              : /*
       2              :  * SPDX-License-Identifier: GPL-3.0-only
       3              :  * MuseScore/Audacity CLA applies
       4              :  *
       5              :  * Copyright (C) MuseScore/Audacity and others
       6              :  *
       7              :  * This program is free software: you can redistribute it and/or modify
       8              :  * it under the terms of the GNU General Public License version 3 as
       9              :  * published by the Free Software Foundation.
      10              :  *
      11              :  * This program is distributed in the hope that it will be useful,
      12              :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      13              :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      14              :  * GNU General Public License for more details.
      15              :  *
      16              :  * You should have received a copy of the GNU General Public License
      17              :  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
      18              :  */
      19              : 
      20              : #pragma once
      21              : 
      22              : #include "icommanddispatcher.h"
      23              : 
      24              : namespace muse::rcommand {
      25              : class Commandable
      26              : {
      27              : public:
      28           41 :     virtual ~Commandable()
      29           41 :     {
      30           41 :         if (m_dispatcher) {
      31            0 :             m_dispatcher->unreg(this);
      32              :         }
      33           41 :     }
      34              : 
      35         1024 :     inline void setDispatcher(ICommandDispatcher* dispatcher)
      36              :     {
      37         1024 :         m_dispatcher = dispatcher;
      38         1024 :     }
      39              : 
      40            0 :     inline bool isDispatcher(const ICommandDispatcher* dispatcher) const
      41              :     {
      42            0 :         return m_dispatcher == dispatcher;
      43              :     }
      44              : 
      45              : private:
      46              : 
      47              :     ICommandDispatcher* m_dispatcher = nullptr;
      48              : };
      49              : }
        

Generated by: LCOV version 2.0-1