MuseScore  3.4
Music composition and notation
telemetrymanager.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2020 MuseScore BVBA
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 2.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __TELEMETRYMANAGER_H__
21 #define __TELEMETRYMANAGER_H__
22 
23 #ifdef BUILD_TELEMETRY_MODULE
24 
25 #include "serviceinjector.h"
26 #include "interfaces/itelemetryservice.h"
27 
28 namespace Ms {
29 
30 //---------------------------------------------------------
31 // TelemetryManager
32 //---------------------------------------------------------
33 
34 class TelemetryManager : public ServiceInjector<ITelemetryService> {
35  INJECT(ITelemetryService, _telemetryService)
36  static std::unique_ptr<TelemetryManager> mgr;
37 
38  static TelemetryManager* instance()
39  {
40  if (!mgr)
41  mgr.reset(new TelemetryManager());
42  return mgr.get();
43  }
44 
45  public:
46  static ITelemetryService* telemetryService()
47  {
48  return instance()->_telemetryService();
49  }
50  };
51 
52 } // namespace Ms
53 
54 #endif // BUILD_TELEMETRY_MODULE
55 #endif // __TELEMETRYMANAGER_H__
Definition: aeolus.cpp:26