Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
CppHotPlugActionExtension.h
Go to the documentation of this file.
1/*****************************************************************************
2 * $CAMITK_LICENCE_BEGIN$
3 *
4 * CamiTK - Computer Assisted Medical Intervention ToolKit
5 * (c) 2001-2025 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6 *
7 * Visit http://camitk.imag.fr for more information
8 *
9 * This file is part of CamiTK.
10 *
11 * CamiTK is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * CamiTK is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22 *
23 * $CAMITK_LICENCE_END$
24 ****************************************************************************/
25
26#ifndef __CPP_HOTPLUG_ACTION_EXTENSION__
27#define __CPP_HOTPLUG_ACTION_EXTENSION__
28
30
31#include <QFileSystemWatcher>
32#include <QMutex>
33
34namespace camitk {
35
41 Q_OBJECT
42
43public:
45 CppHotPlugActionExtension(const QString& camitkFilePath, bool forceRebuild = false);
46
49
51 virtual QString getProgrammingLanguage() const override {
52 return "C++";
53 }
54
60 virtual bool initActions(int progressMinimum = 0, int progressMaximum = 100) override;
61
68 void watchActionLibrary(QString libraryPath, HotPlugAction* action);
69
70private slots:
72 void extensionRebuilt(const QString& path, int timerCallCount = 0);
73
75 void updateWatchedFiles();
76
77private:
79 virtual void rebuild();
80
82 QMutex reloadMutex;
83
86 QFileSystemWatcher fileSystemWatcher;
87
89 QMap<QString, HotPlugAction*> watchedUserActionLibraries;
90};
91
92} // namespace camitk
93
94#endif // __CPP_HOTPLUG_ACTION_EXTENSION__
#define CAMITK_API
Definition CamiTKAPI.h:66
An ActionExtension that can be created on the fly from a camitk extension file.
Definition CppHotPlugActionExtension.h:40
virtual QString getProgrammingLanguage() const override
get the programming language of this extension
Definition CppHotPlugActionExtension.h:51
An ActionExtension that can be created on the fly from a camitk extension file.
Definition HotPlugActionExtension.h:44
An Action that can be created on the fly.
Definition HotPlugAction.h:40
Definition action.py:1
Definition Action.cpp:40