#include "decoder.hpp"
-#include <pv/view/logicsignal.hpp>
+#include <pv/data/signalbase.hpp>
using std::set;
using std::map;
Decoder::~Decoder()
{
- for (auto & option : options_)
+ for (auto& option : options_)
g_variant_unref(option.second);
}
shown_ = show;
}
-const map<const srd_channel*, shared_ptr<view::LogicSignal> >&
+const map<const srd_channel*, shared_ptr<data::SignalBase> >&
Decoder::channels() const
{
return channels_;
}
void Decoder::set_channels(std::map<const srd_channel*,
- std::shared_ptr<view::LogicSignal> > channels)
+ std::shared_ptr<data::SignalBase> > channels)
{
channels_ = channels;
}
set< shared_ptr<pv::data::Logic> > Decoder::get_data()
{
set< shared_ptr<pv::data::Logic> > data;
- for (const auto & channel : channels_) {
- shared_ptr<view::LogicSignal> signal(channel.second);
- assert(signal);
- data.insert(signal->logic_data());
+ for (const auto& channel : channels_) {
+ shared_ptr<data::SignalBase> b(channel.second);
+ assert(b);
+ data.insert(b->logic_data());
}
return data;
GHashTable *const opt_hash = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
- for (const auto & option : options_) {
+ for (const auto& option : options_) {
GVariant *const value = option.second;
g_variant_ref(value);
g_hash_table_replace(opt_hash, (void*)g_strdup(
GHashTable *const channels = g_hash_table_new_full(g_str_hash,
g_str_equal, g_free, (GDestroyNotify)g_variant_unref);
- for (const auto & channel : channels_) {
- shared_ptr<view::LogicSignal> signal(channel.second);
- GVariant *const gvar = g_variant_new_int32(
- signal->channel()->index());
+ for (const auto& channel : channels_) {
+ shared_ptr<data::SignalBase> b(channel.second);
+ GVariant *const gvar = g_variant_new_int32(b->index());
g_variant_ref_sink(gvar);
g_hash_table_insert(channels, channel.first->id, gvar);
}