X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fdata%2Flogicsnapshot.h;h=bcb644da58da7073831883920f4294535eae8a2d;hb=bb3030b34e44733036acdfe5b4d4ec0705146831;hp=8a851ac203539e92d93fb971b499960afe0d4d7e;hpb=1b1ec774978b65209ce2b454cbf81da499b797d2;p=pulseview.git diff --git a/pv/data/logicsnapshot.h b/pv/data/logicsnapshot.h index 8a851ac2..bcb644da 100644 --- a/pv/data/logicsnapshot.h +++ b/pv/data/logicsnapshot.h @@ -27,11 +27,11 @@ #include namespace LogicSnapshotTest { - class Pow2; - class Basic; - class LargeData; - class Pulses; - class LongPulses; +struct Pow2; +struct Basic; +struct LargeData; +struct Pulses; +struct LongPulses; } namespace pv { @@ -58,14 +58,21 @@ public: typedef std::pair EdgePair; public: - LogicSnapshot(const sr_datafeed_logic &logic); + LogicSnapshot(const sr_datafeed_logic &logic, + uint64_t expected_num_samples = 0); virtual ~LogicSnapshot(); void append_payload(const sr_datafeed_logic &logic); + void get_samples(uint8_t *const data, + int64_t start_sample, int64_t end_sample) const; + private: - void reallocate_mip_map(MipMapLevel &m); + uint64_t unpack_sample(const uint8_t *ptr) const; + void pack_sample(uint8_t *ptr, uint64_t value); + + void reallocate_mipmap_level(MipMapLevel &m); void append_payload_to_mipmap(); @@ -95,11 +102,11 @@ private: struct MipMapLevel _mip_map[ScaleStepCount]; uint64_t _last_append_sample; - friend class LogicSnapshotTest::Pow2; - friend class LogicSnapshotTest::Basic; - friend class LogicSnapshotTest::LargeData; - friend class LogicSnapshotTest::Pulses; - friend class LogicSnapshotTest::LongPulses; + friend struct LogicSnapshotTest::Pow2; + friend struct LogicSnapshotTest::Basic; + friend struct LogicSnapshotTest::LargeData; + friend struct LogicSnapshotTest::Pulses; + friend struct LogicSnapshotTest::LongPulses; }; } // namespace data