]>
Commit | Line | Data |
---|---|---|
7491a29f JH |
1 | /* |
2 | * This file is part of the PulseView project. | |
3 | * | |
4 | * Copyright (C) 2013 Joel Holdsworth <joel@airwebreathe.org.uk> | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation; either version 2 of the License, or | |
9 | * (at your option) any later version. | |
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, write to the Free Software | |
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
19 | */ | |
20 | ||
21 | #ifndef PULSEVIEW_PV_DATA_DECODE_DECODER_H | |
22 | #define PULSEVIEW_PV_DATA_DECODE_DECODER_H | |
23 | ||
24 | #include <map> | |
f9abf97e | 25 | #include <memory> |
ddee4cf8 | 26 | #include <set> |
7491a29f | 27 | |
7491a29f JH |
28 | #include <glib.h> |
29 | ||
30 | struct srd_decoder; | |
31 | struct srd_decoder_inst; | |
8bd26d8b | 32 | struct srd_channel; |
7491a29f JH |
33 | struct srd_session; |
34 | ||
35 | namespace pv { | |
36 | ||
37 | namespace view { | |
38 | class LogicSignal; | |
39 | } | |
40 | ||
41 | namespace data { | |
ddee4cf8 JH |
42 | |
43 | class Logic; | |
44 | ||
7491a29f JH |
45 | namespace decode { |
46 | ||
47 | class Decoder | |
48 | { | |
49 | public: | |
50 | Decoder(const srd_decoder *const decoder); | |
51 | ||
52 | virtual ~Decoder(); | |
53 | ||
54 | const srd_decoder* decoder() const; | |
55 | ||
dd048a7e JH |
56 | bool shown() const; |
57 | void show(bool show = true); | |
58 | ||
8bd26d8b | 59 | const std::map<const srd_channel*, |
f9abf97e | 60 | std::shared_ptr<view::LogicSignal> >& channels() const; |
8bd26d8b | 61 | void set_probes(std::map<const srd_channel*, |
f9abf97e | 62 | std::shared_ptr<view::LogicSignal> > probes); |
7491a29f | 63 | |
615f6d25 | 64 | const std::map<std::string, GVariant*>& options() const; |
7491a29f JH |
65 | |
66 | void set_option(const char *id, GVariant *value); | |
67 | ||
a2d4b551 JH |
68 | bool have_required_probes() const; |
69 | ||
7491a29f | 70 | srd_decoder_inst* create_decoder_inst( |
13a3528c | 71 | srd_session *session, int unit_size) const; |
7491a29f | 72 | |
f9abf97e | 73 | std::set< std::shared_ptr<pv::data::Logic> > get_data(); |
ddee4cf8 | 74 | |
7491a29f JH |
75 | private: |
76 | const srd_decoder *const _decoder; | |
dd048a7e JH |
77 | |
78 | bool _shown; | |
79 | ||
f9abf97e | 80 | std::map<const srd_channel*, std::shared_ptr<pv::view::LogicSignal> > |
7491a29f | 81 | _probes; |
615f6d25 | 82 | std::map<std::string, GVariant*> _options; |
7491a29f JH |
83 | }; |
84 | ||
85 | } // namespace decode | |
86 | } // namespace data | |
87 | } // namespace pv | |
88 | ||
89 | #endif // PULSEVIEW_PV_DATA_DECODE_DECODER_H |