namespace data {
namespace decode {
-Decoder::Decoder(const srd_decoder *const dec) :
+Decoder::Decoder(const srd_decoder *const dec, uint8_t stack_level) :
srd_decoder_(dec),
+ stack_level_(stack_level),
visible_(true),
decoder_inst_(nullptr)
{
for (const GSList *rl = srd_decoder_->annotation_rows; rl; rl = rl->next) {
const srd_decoder_annotation_row *const srd_row = (srd_decoder_annotation_row *)rl->data;
assert(srd_row);
- rows_.push_back({i++, this, srd_row});
+ rows_.emplace_back(i++, this, srd_row);
// FIXME PV can crash from .at() if a PD's ann classes are defined incorrectly
for (const GSList *cl = srd_row->ann_classes; cl; cl = cl->next)
if (rows_.empty()) {
// Make sure there is a row for PDs without row declarations
- rows_.push_back({0, this});
+ rows_.emplace_back(0, this);
for (AnnotationClass& c : ann_classes_)
c.row = &(rows_.back());
return srd_decoder_;
}
+uint8_t Decoder::get_stack_level() const
+{
+ return stack_level_;
+}
+
const char* Decoder::name() const
{
return srd_decoder_->name;
return &(ann_classes_[id]);
}
+const AnnotationClass* Decoder::get_ann_class_by_id(size_t id) const
+{
+ if (id >= ann_classes_.size())
+ return nullptr;
+
+ return &(ann_classes_[id]);
+}
+
uint32_t Decoder::get_binary_class_count() const
{
return bin_classes_.size();