23 #include <libsigrokcxx/libsigrokcxx.hpp>
24 #include <libsigrokdecode/libsigrokdecode.h>
32 using std::shared_ptr;
48 g_variant_unref((*i).second);
66 const map<const srd_channel*, shared_ptr<view::LogicSignal> >&
73 std::shared_ptr<view::LogicSignal> > channels)
92 for (GSList *l =
decoder_->channels; l; l = l->next) {
93 const srd_channel *
const pdch = (
const srd_channel*)l->data;
104 set< shared_ptr<pv::data::Logic> > data;
106 shared_ptr<view::LogicSignal> signal((*i).second);
108 data.insert(signal->logic_data());
116 GHashTable *
const opt_hash = g_hash_table_new_full(g_str_hash,
117 g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
121 GVariant *
const value = (*i).second;
122 g_variant_ref(value);
123 g_hash_table_replace(opt_hash, (
void*)g_strdup(
124 (*i).first.c_str()), value);
127 srd_decoder_inst *
const decoder_inst = srd_inst_new(
129 g_hash_table_destroy(opt_hash);
135 GHashTable *
const channels = g_hash_table_new_full(g_str_hash,
136 g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
140 shared_ptr<view::LogicSignal> signal((*i).second);
141 GVariant *
const gvar = g_variant_new_int32(
142 signal->channel()->index());
143 g_variant_ref_sink(gvar);
144 g_hash_table_insert(channels, (*i).first->id, gvar);
147 srd_inst_channel_set_all(decoder_inst, channels);
std::map< const srd_channel *, std::shared_ptr< pv::view::LogicSignal > > channels_
const srd_decoder *const decoder_
void set_channels(std::map< const srd_channel *, std::shared_ptr< view::LogicSignal > > channels)
std::map< std::string, GVariant * > options_
const srd_decoder * decoder() const
const std::map< const srd_channel *, std::shared_ptr< view::LogicSignal > > & channels() const
Decoder(const srd_decoder *const decoder)
void set_option(const char *id, GVariant *value)
bool have_required_channels() const
std::set< std::shared_ptr< pv::data::Logic > > get_data()
const std::map< std::string, GVariant * > & options() const
srd_decoder_inst * create_decoder_inst(srd_session *session) const
void show(bool show=true)