]> sigrok.org Git - pulseview.git/blame - pv/data/decode/decoder.hpp
Modified header guards to match file names
[pulseview.git] / pv / data / decode / decoder.hpp
CommitLineData
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
7a01bd36
JH
21#ifndef PULSEVIEW_PV_DATA_DECODE_DECODER_HPP
22#define PULSEVIEW_PV_DATA_DECODE_DECODER_HPP
7491a29f
JH
23
24#include <map>
f9abf97e 25#include <memory>
ddee4cf8 26#include <set>
7491a29f 27
7491a29f
JH
28#include <glib.h>
29
30struct srd_decoder;
31struct srd_decoder_inst;
8bd26d8b 32struct srd_channel;
7491a29f
JH
33struct srd_session;
34
35namespace pv {
36
37namespace view {
38class LogicSignal;
39}
40
41namespace data {
ddee4cf8
JH
42
43class Logic;
44
7491a29f
JH
45namespace decode {
46
47class Decoder
48{
49public:
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;
6ac6242b
ML
61 void set_channels(std::map<const srd_channel*,
62 std::shared_ptr<view::LogicSignal> > channels);
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
6ac6242b 68 bool have_required_channels() const;
a2d4b551 69
7491a29f 70 srd_decoder_inst* create_decoder_inst(
13a3528c 71 srd_session *session, int unit_size) const;
7491a29f 72
360ab9be 73 std::set< std::shared_ptr<pv::data::Logic> > get_data();
ddee4cf8 74
7491a29f 75private:
8dbbc7f0 76 const srd_decoder *const decoder_;
dd048a7e 77
8dbbc7f0 78 bool shown_;
dd048a7e 79
f9abf97e 80 std::map<const srd_channel*, std::shared_ptr<pv::view::LogicSignal> >
8dbbc7f0
JH
81 channels_;
82 std::map<std::string, GVariant*> options_;
7491a29f
JH
83};
84
85} // namespace decode
86} // namespace data
87} // namespace pv
88
7a01bd36 89#endif // PULSEVIEW_PV_DATA_DECODE_DECODER_HPP