Switch to C++11 for Kaitai-generated parsers

This commit is contained in:
Nikolaj Schlej 2023-02-26 13:23:25 -08:00
parent 255742f371
commit 75bf036137
15 changed files with 316 additions and 745 deletions

View file

@ -1,10 +1,10 @@
#ifndef INTEL_ACBP_V1_H_
#define INTEL_ACBP_V1_H_
#pragma once
// This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
#include "../kaitai/kaitaistruct.h"
#include <stdint.h>
#include <memory>
#include <vector>
#if KAITAI_STRUCT_VERSION < 9000L
@ -38,7 +38,7 @@ public:
STRUCTURE_IDS_IBBS = 6872303100435717983LL
};
intel_acbp_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acbp_v1_t* p__root = 0);
intel_acbp_v1_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -51,7 +51,7 @@ public:
public:
pmsg_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
pmsg_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -63,18 +63,18 @@ public:
private:
uint8_t m_version;
uint16_t m_key_id;
public_key_t* m_public_key;
std::unique_ptr<public_key_t> m_public_key;
uint16_t m_sig_scheme;
signature_t* m_signature;
std::unique_ptr<signature_t> m_signature;
intel_acbp_v1_t* m__root;
intel_acbp_v1_t::acbp_element_t* m__parent;
public:
uint8_t version() const { return m_version; }
uint16_t key_id() const { return m_key_id; }
public_key_t* public_key() const { return m_public_key; }
public_key_t* public_key() const { return m_public_key.get(); }
uint16_t sig_scheme() const { return m_sig_scheme; }
signature_t* signature() const { return m_signature; }
signature_t* signature() const { return m_signature.get(); }
intel_acbp_v1_t* _root() const { return m__root; }
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
};
@ -83,7 +83,7 @@ public:
public:
acbp_element_t(kaitai::kstream* p__io, intel_acbp_v1_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
acbp_element_t(kaitai::kstream* p__io, intel_acbp_v1_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -93,22 +93,22 @@ public:
~acbp_element_t();
private:
common_header_t* m_header;
ibbs_body_t* m_ibbs_body;
std::unique_ptr<common_header_t> m_header;
std::unique_ptr<ibbs_body_t> m_ibbs_body;
bool n_ibbs_body;
public:
bool _is_null_ibbs_body() { ibbs_body(); return n_ibbs_body; };
private:
pmda_body_t* m_pmda_body;
std::unique_ptr<pmda_body_t> m_pmda_body;
bool n_pmda_body;
public:
bool _is_null_pmda_body() { pmda_body(); return n_pmda_body; };
private:
pmsg_body_t* m_pmsg_body;
std::unique_ptr<pmsg_body_t> m_pmsg_body;
bool n_pmsg_body;
public:
@ -126,10 +126,10 @@ public:
intel_acbp_v1_t* m__parent;
public:
common_header_t* header() const { return m_header; }
ibbs_body_t* ibbs_body() const { return m_ibbs_body; }
pmda_body_t* pmda_body() const { return m_pmda_body; }
pmsg_body_t* pmsg_body() const { return m_pmsg_body; }
common_header_t* header() const { return m_header.get(); }
ibbs_body_t* ibbs_body() const { return m_ibbs_body.get(); }
pmda_body_t* pmda_body() const { return m_pmda_body.get(); }
pmsg_body_t* pmsg_body() const { return m_pmsg_body.get(); }
std::string invalid_body() const { return m_invalid_body; }
intel_acbp_v1_t* _root() const { return m__root; }
intel_acbp_v1_t* _parent() const { return m__parent; }
@ -139,7 +139,7 @@ public:
public:
common_header_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
common_header_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -165,7 +165,7 @@ public:
public:
signature_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
signature_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -195,7 +195,7 @@ public:
public:
pmda_entry_v1_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
pmda_entry_v1_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -223,7 +223,7 @@ public:
public:
ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v1_t::ibbs_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
ibb_segment_t(kaitai::kstream* p__io, intel_acbp_v1_t::ibbs_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -253,7 +253,7 @@ public:
public:
public_key_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
public_key_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmsg_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -283,7 +283,7 @@ public:
public:
hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = 0, intel_acbp_v1_t* p__root = 0);
hash_t(kaitai::kstream* p__io, kaitai::kstruct* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -311,7 +311,7 @@ public:
public:
pmda_entry_v2_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
pmda_entry_v2_t(kaitai::kstream* p__io, intel_acbp_v1_t::pmda_body_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -323,14 +323,14 @@ public:
private:
uint32_t m_base;
uint32_t m_size;
hash_t* m_hash;
std::unique_ptr<hash_t> m_hash;
intel_acbp_v1_t* m__root;
intel_acbp_v1_t::pmda_body_t* m__parent;
public:
uint32_t base() const { return m_base; }
uint32_t size() const { return m_size; }
hash_t* hash() const { return m_hash; }
hash_t* hash() const { return m_hash.get(); }
intel_acbp_v1_t* _root() const { return m__root; }
intel_acbp_v1_t::pmda_body_t* _parent() const { return m__parent; }
};
@ -339,7 +339,7 @@ public:
public:
ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
ibbs_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -349,7 +349,7 @@ public:
~ibbs_body_t();
private:
std::vector<uint8_t>* m_reserved;
std::unique_ptr<std::vector<uint8_t>> m_reserved;
uint32_t m_flags;
uint64_t m_mch_bar;
uint64_t m_vtd_bar;
@ -357,16 +357,16 @@ public:
uint32_t m_dma_protection_limit0;
uint64_t m_dma_protection_base1;
uint64_t m_dma_protection_limit1;
hash_t* m_post_ibb_hash;
std::unique_ptr<hash_t> m_post_ibb_hash;
uint32_t m_ibb_entry_point;
hash_t* m_ibb_hash;
std::unique_ptr<hash_t> m_ibb_hash;
uint8_t m_num_ibb_segments;
std::vector<ibb_segment_t*>* m_ibb_segments;
std::unique_ptr<std::vector<std::unique_ptr<ibb_segment_t>>> m_ibb_segments;
intel_acbp_v1_t* m__root;
intel_acbp_v1_t::acbp_element_t* m__parent;
public:
std::vector<uint8_t>* reserved() const { return m_reserved; }
std::vector<uint8_t>* reserved() const { return m_reserved.get(); }
uint32_t flags() const { return m_flags; }
uint64_t mch_bar() const { return m_mch_bar; }
uint64_t vtd_bar() const { return m_vtd_bar; }
@ -374,11 +374,11 @@ public:
uint32_t dma_protection_limit0() const { return m_dma_protection_limit0; }
uint64_t dma_protection_base1() const { return m_dma_protection_base1; }
uint64_t dma_protection_limit1() const { return m_dma_protection_limit1; }
hash_t* post_ibb_hash() const { return m_post_ibb_hash; }
hash_t* post_ibb_hash() const { return m_post_ibb_hash.get(); }
uint32_t ibb_entry_point() const { return m_ibb_entry_point; }
hash_t* ibb_hash() const { return m_ibb_hash; }
hash_t* ibb_hash() const { return m_ibb_hash.get(); }
uint8_t num_ibb_segments() const { return m_num_ibb_segments; }
std::vector<ibb_segment_t*>* ibb_segments() const { return m_ibb_segments; }
std::vector<std::unique_ptr<ibb_segment_t>>* ibb_segments() const { return m_ibb_segments.get(); }
intel_acbp_v1_t* _root() const { return m__root; }
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
};
@ -387,7 +387,7 @@ public:
public:
pmda_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = 0, intel_acbp_v1_t* p__root = 0);
pmda_body_t(kaitai::kstream* p__io, intel_acbp_v1_t::acbp_element_t* p__parent = nullptr, intel_acbp_v1_t* p__root = nullptr);
private:
void _read();
@ -400,14 +400,14 @@ public:
uint16_t m_total_size;
uint32_t m_version;
uint32_t m_num_entries;
std::vector<pmda_entry_v1_t*>* m_entries_v1;
std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v1_t>>> m_entries_v1;
bool n_entries_v1;
public:
bool _is_null_entries_v1() { entries_v1(); return n_entries_v1; };
private:
std::vector<pmda_entry_v2_t*>* m_entries_v2;
std::unique_ptr<std::vector<std::unique_ptr<pmda_entry_v2_t>>> m_entries_v2;
bool n_entries_v2;
public:
@ -421,8 +421,8 @@ public:
uint16_t total_size() const { return m_total_size; }
uint32_t version() const { return m_version; }
uint32_t num_entries() const { return m_num_entries; }
std::vector<pmda_entry_v1_t*>* entries_v1() const { return m_entries_v1; }
std::vector<pmda_entry_v2_t*>* entries_v2() const { return m_entries_v2; }
std::vector<std::unique_ptr<pmda_entry_v1_t>>* entries_v1() const { return m_entries_v1.get(); }
std::vector<std::unique_ptr<pmda_entry_v2_t>>* entries_v2() const { return m_entries_v2.get(); }
intel_acbp_v1_t* _root() const { return m__root; }
intel_acbp_v1_t::acbp_element_t* _parent() const { return m__parent; }
};
@ -436,7 +436,7 @@ private:
uint8_t m_acm_svn;
uint8_t m_reserved1;
uint16_t m_nem_data_size;
std::vector<acbp_element_t*>* m_elements;
std::unique_ptr<std::vector<std::unique_ptr<acbp_element_t>>> m_elements;
intel_acbp_v1_t* m__root;
kaitai::kstruct* m__parent;
@ -449,9 +449,7 @@ public:
uint8_t acm_svn() const { return m_acm_svn; }
uint8_t reserved1() const { return m_reserved1; }
uint16_t nem_data_size() const { return m_nem_data_size; }
std::vector<acbp_element_t*>* elements() const { return m_elements; }
std::vector<std::unique_ptr<acbp_element_t>>* elements() const { return m_elements.get(); }
intel_acbp_v1_t* _root() const { return m__root; }
kaitai::kstruct* _parent() const { return m__parent; }
};
#endif // INTEL_ACBP_V1_H_