PulseView  unreleased development snapshot
A Qt-based sigrok GUI
pv::data::Segment Class Reference

#include <segment.hpp>

Inheritance diagram for pv::data::Segment:
Collaboration diagram for pv::data::Segment:

Signals

void completed ()
 

Public Member Functions

 Segment (uint32_t segment_id, uint64_t samplerate, unsigned int unit_size)
 
virtual ~Segment ()
 
uint64_t get_sample_count () const
 
const pv::util::Timestampstart_time () const
 
double samplerate () const
 
void set_samplerate (double samplerate)
 
unsigned int unit_size () const
 
uint32_t segment_id () const
 
void set_complete ()
 
bool is_complete () const
 
void free_unused_memory ()
 

Protected Member Functions

void append_single_sample (void *data)
 
void append_samples (void *data, uint64_t samples)
 
const uint8_t * get_raw_sample (uint64_t sample_num) const
 
void get_raw_samples (uint64_t start, uint64_t count, uint8_t *dest) const
 
SegmentDataIteratorbegin_sample_iteration (uint64_t start)
 
void continue_sample_iteration (SegmentDataIterator *it, uint64_t increase)
 
void end_sample_iteration (SegmentDataIterator *it)
 
uint8_t * get_iterator_value (SegmentDataIterator *it)
 
uint64_t get_iterator_valid_length (SegmentDataIterator *it)
 

Protected Attributes

uint32_t segment_id_
 
recursive_mutex mutex_
 
deque< uint8_t * > data_chunks_
 
uint8_t * current_chunk_
 
uint64_t used_samples_
 
uint64_t unused_samples_
 
atomic< uint64_t > sample_count_
 
pv::util::Timestamp start_time_
 
double samplerate_
 
uint64_t chunk_size_
 
unsigned int unit_size_
 
int iterator_count_
 
bool mem_optimization_requested_
 
bool is_complete_
 

Static Private Attributes

static const uint64_t MaxChunkSize = 10 * 1024 * 1024
 

Friends

struct SegmentTest::SmallSize8Single
 
struct SegmentTest::MediumSize8Single
 
struct SegmentTest::MaxSize8Single
 
struct SegmentTest::MediumSize24Single
 
struct SegmentTest::MediumSize32Single
 
struct SegmentTest::MaxSize32Single
 
struct SegmentTest::MediumSize32Multi
 
struct SegmentTest::MaxSize32Multi
 
struct SegmentTest::MaxSize32MultiAtOnce
 
struct SegmentTest::MaxSize32MultiIterated
 

Detailed Description

Definition at line 59 of file segment.hpp.

Constructor & Destructor Documentation

pv::data::Segment::Segment ( uint32_t  segment_id,
uint64_t  samplerate,
unsigned int  unit_size 
)

Definition at line 39 of file segment.cpp.

Here is the call graph for this function:

pv::data::Segment::~Segment ( )
virtual

Definition at line 62 of file segment.cpp.

Member Function Documentation

void pv::data::Segment::append_samples ( void *  data,
uint64_t  samples 
)
protected

Definition at line 156 of file segment.cpp.

Here is the caller graph for this function:

void pv::data::Segment::append_single_sample ( void *  data)
protected

Definition at line 135 of file segment.cpp.

SegmentDataIterator * pv::data::Segment::begin_sample_iteration ( uint64_t  start)
protected

Definition at line 258 of file segment.cpp.

Here is the caller graph for this function:

void pv::data::Segment::completed ( )
signal

Definition at line 122 of file moc_segment.cpp.

Here is the caller graph for this function:

void pv::data::Segment::continue_sample_iteration ( SegmentDataIterator it,
uint64_t  increase 
)
protected

Definition at line 274 of file segment.cpp.

Here is the caller graph for this function:

void pv::data::Segment::end_sample_iteration ( SegmentDataIterator it)
protected

Definition at line 286 of file segment.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void pv::data::Segment::free_unused_memory ( )

Definition at line 112 of file segment.cpp.

Here is the caller graph for this function:

uint64_t pv::data::Segment::get_iterator_valid_length ( SegmentDataIterator it)
protected

Definition at line 305 of file segment.cpp.

Here is the caller graph for this function:

uint8_t * pv::data::Segment::get_iterator_value ( SegmentDataIterator it)
protected

Definition at line 298 of file segment.cpp.

Here is the caller graph for this function:

const uint8_t * pv::data::Segment::get_raw_sample ( uint64_t  sample_num) const
protected

Definition at line 214 of file segment.cpp.

Here is the caller graph for this function:

void pv::data::Segment::get_raw_samples ( uint64_t  start,
uint64_t  count,
uint8_t *  dest 
) const
protected

Definition at line 228 of file segment.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint64_t pv::data::Segment::get_sample_count ( ) const

Definition at line 70 of file segment.cpp.

Here is the caller graph for this function:

bool pv::data::Segment::is_complete ( ) const

Definition at line 107 of file segment.cpp.

double pv::data::Segment::samplerate ( ) const

Definition at line 80 of file segment.cpp.

Here is the caller graph for this function:

uint32_t pv::data::Segment::segment_id ( ) const

Definition at line 95 of file segment.cpp.

void pv::data::Segment::set_complete ( )

Definition at line 100 of file segment.cpp.

void pv::data::Segment::set_samplerate ( double  samplerate)

Definition at line 85 of file segment.cpp.

Here is the call graph for this function:

const pv::util::Timestamp & pv::data::Segment::start_time ( ) const

Definition at line 75 of file segment.cpp.

unsigned int pv::data::Segment::unit_size ( ) const

Definition at line 90 of file segment.cpp.

Friends And Related Function Documentation

friend struct SegmentTest::MaxSize32Multi
friend

Definition at line 123 of file segment.hpp.

friend struct SegmentTest::MaxSize32MultiAtOnce
friend

Definition at line 124 of file segment.hpp.

friend struct SegmentTest::MaxSize32MultiIterated
friend

Definition at line 125 of file segment.hpp.

friend struct SegmentTest::MaxSize32Single
friend

Definition at line 121 of file segment.hpp.

friend struct SegmentTest::MaxSize8Single
friend

Definition at line 118 of file segment.hpp.

friend struct SegmentTest::MediumSize24Single
friend

Definition at line 119 of file segment.hpp.

friend struct SegmentTest::MediumSize32Multi
friend

Definition at line 122 of file segment.hpp.

friend struct SegmentTest::MediumSize32Single
friend

Definition at line 120 of file segment.hpp.

friend struct SegmentTest::MediumSize8Single
friend

Definition at line 117 of file segment.hpp.

friend struct SegmentTest::SmallSize8Single
friend

Definition at line 116 of file segment.hpp.

Member Data Documentation

uint64_t pv::data::Segment::chunk_size_
protected

Definition at line 110 of file segment.hpp.

uint8_t* pv::data::Segment::current_chunk_
protected

Definition at line 105 of file segment.hpp.

deque<uint8_t*> pv::data::Segment::data_chunks_
protected

Definition at line 104 of file segment.hpp.

bool pv::data::Segment::is_complete_
protected

Definition at line 114 of file segment.hpp.

int pv::data::Segment::iterator_count_
protected

Definition at line 112 of file segment.hpp.

const uint64_t pv::data::Segment::MaxChunkSize = 10 * 1024 * 1024
staticprivate

Definition at line 64 of file segment.hpp.

bool pv::data::Segment::mem_optimization_requested_
protected

Definition at line 113 of file segment.hpp.

recursive_mutex pv::data::Segment::mutex_
mutableprotected

Definition at line 103 of file segment.hpp.

atomic<uint64_t> pv::data::Segment::sample_count_
protected

Definition at line 107 of file segment.hpp.

double pv::data::Segment::samplerate_
protected

Definition at line 109 of file segment.hpp.

uint32_t pv::data::Segment::segment_id_
protected

Definition at line 102 of file segment.hpp.

pv::util::Timestamp pv::data::Segment::start_time_
protected

Definition at line 108 of file segment.hpp.

unsigned int pv::data::Segment::unit_size_
protected

Definition at line 111 of file segment.hpp.

uint64_t pv::data::Segment::unused_samples_
protected

Definition at line 106 of file segment.hpp.

uint64_t pv::data::Segment::used_samples_
protected

Definition at line 106 of file segment.hpp.


The documentation for this class was generated from the following files: