ngscopeclient 0.1-dev+51fbda87c
Public Member Functions | Public Attributes | List of all members
SparseWaveform< S > Class Template Reference

A waveform sampled at irregular intervals. More...

#include <Waveform.h>

Inheritance diagram for SparseWaveform< S >:
Inheritance graph
[legend]
Collaboration diagram for SparseWaveform< S >:
Collaboration graph
[legend]

Public Member Functions

 SparseWaveform (const std::string &name="")
 Creates a new sparse waveform. More...
 
virtual void Rename (const std::string &name="") override
 Assings a human readable name to the waveform for debug purposes. More...
 
 SparseWaveform (UniformWaveform< S > &rhs)
 Constructs a sparse waveform as a copy of a uniform waveform, marking all samples as 1 timebase unit in length.
 
virtual void FreeGpuMemory () override
 Free GPU-side memory if we are short on VRAM or do not anticipate using this waveform for a while. More...
 
virtual bool HasGpuBuffer () override
 Returns true if we have at least one buffer resident on the GPU. More...
 
virtual void Resize (size_t size) override
 Reallocates buffers so the waveform contains the specified number of samples. More...
 
virtual size_t size () const override
 Returns the number of samples in this waveform. More...
 
virtual void clear () override
 Remove all samples from this waveform. More...
 
virtual void PrepareForCpuAccess () override
 Indicates that this waveform is going to be used by the CPU in the near future. More...
 
virtual void PrepareForGpuAccess () override
 Indicates that this waveform is going to be used by the CPU in the near future. More...
 
virtual void MarkSamplesModifiedFromCpu () override
 Indicates that this waveform's sample data has been modified on the CPU and the GPU-side copy is no longer coherent. More...
 
virtual void MarkSamplesModifiedFromGpu () override
 Indicates that this waveform's sample data has been modified on the GPU and the CPU-side copy is no longer coherent. More...
 
void SetGpuAccessHint (enum AcceleratorBuffer< S >::UsageHint hint)
 Passes a hint to the memory allocator about where our sample data is expected to be used. More...
 
- Public Member Functions inherited from SparseWaveformBase
 SparseWaveformBase ()
 Constructs a new empty sparse waveform.
 
void CopyTimestamps (const SparseWaveformBase *rhs)
 Copies offsets/durations from another waveform into this one. More...
 
void MarkTimestampsModifiedFromCpu ()
 
void MarkTimestampsModifiedFromGpu ()
 
virtual void MarkModifiedFromCpu () override
 Indicates that this waveform's sample data and timestamps have been modified on the CPU and the GPU-side copy is no longer coherent. More...
 
virtual void MarkModifiedFromGpu () override
 Indicates that this waveform's sample data and timestamps have been modified on the GPU and the CPU-side copy is no longer coherent. More...
 
- Public Member Functions inherited from WaveformBase
 WaveformBase ()
 Creates an empty waveform.
 
 WaveformBase (const WaveformBase &rhs)
 Creates a waveform, copying metadata from another.
 
virtual void Rename (const std::string &name="")=0
 Assings a human readable name to the waveform for debug purposes. More...
 
virtual void clear ()=0
 Remove all samples from this waveform. More...
 
virtual void Resize (size_t size)=0
 Reallocates buffers so the waveform contains the specified number of samples. More...
 
virtual size_t size () const =0
 Returns the number of samples in this waveform. More...
 
virtual bool empty ()
 Returns true if this waveform contains no samples, false otherwise.
 
virtual std::string GetText (size_t i)
 Returns the text representation of a given protocol sample. More...
 
virtual std::string GetColor (size_t)
 Returns the displayed color (in HTML #rrggbb or #rrggbbaa notation) of a given protocol sample. More...
 
virtual uint32_t GetColorCached (size_t i)
 Returns the packed RGBA32 color of a given protocol sample calculated by CacheColors() More...
 
virtual void PrepareForCpuAccess ()=0
 Indicates that this waveform is going to be used by the CPU in the near future. More...
 
virtual void PrepareForGpuAccess ()=0
 Indicates that this waveform is going to be used by the CPU in the near future. More...
 
virtual void MarkSamplesModifiedFromCpu ()=0
 Indicates that this waveform's sample data has been modified on the CPU and the GPU-side copy is no longer coherent. More...
 
virtual void MarkSamplesModifiedFromGpu ()=0
 Indicates that this waveform's sample data has been modified on the GPU and the CPU-side copy is no longer coherent. More...
 
virtual void MarkModifiedFromCpu ()=0
 Indicates that this waveform's sample data and timestamps have been modified on the CPU and the GPU-side copy is no longer coherent. More...
 
virtual void MarkModifiedFromGpu ()=0
 Indicates that this waveform's sample data and timestamps have been modified on the GPU and the CPU-side copy is no longer coherent. More...
 
virtual void CacheColors ()
 Updates the cache of packed colors to avoid string parsing every frame.
 
virtual void FreeGpuMemory ()=0
 Free GPU-side memory if we are short on VRAM or do not anticipate using this waveform for a while. More...
 
virtual bool HasGpuBuffer ()=0
 Returns true if we have at least one buffer resident on the GPU. More...
 

Public Attributes

AcceleratorBuffer< S > m_samples
 Sample data.
 
- Public Attributes inherited from SparseWaveformBase
AcceleratorBuffer< int64_t > m_offsets
 Start timestamps of each sample, in multiples of m_timescale.
 
AcceleratorBuffer< int64_t > m_durations
 Durations of each sample, in multiples of m_timescale.
 
- Public Attributes inherited from WaveformBase
int64_t m_timescale
 The time scale, in X axis units (usually femtoseconds) per timestep, used by this channel. More...
 
time_t m_startTimestamp
 Start time of the acquisition, integer part.
 
int64_t m_startFemtoseconds
 Start time of the acquisition, fractional part (femtoseconds since since the UTC second)
 
int64_t m_triggerPhase
 Offset, in X axis units (usually femtoseconds), from the trigger to the sampling clock. More...
 
uint8_t m_flags
 Flags that apply to this waveform. Bitfield containing zero or more WaveformFlags_t values.
 
uint64_t m_revision
 Revision number. More...
 

Additional Inherited Members

- Public Types inherited from WaveformBase
enum  WaveformFlags_t { WAVEFORM_CLIPPING = 1 }
 Flags which may apply to m_flags. More...
 
- Protected Attributes inherited from WaveformBase
AcceleratorBuffer< uint32_t > m_protocolColors
 Cache of packed RGBA32 data with colors for each protocol decode event. Empty for non-protocol waveforms.
 
uint64_t m_cachedColorRevision
 Revision we last cached colors of.
 

Detailed Description

template<class S>
class SparseWaveform< S >

A waveform sampled at irregular intervals.

Constructor & Destructor Documentation

◆ SparseWaveform()

template<class S >
SparseWaveform< S >::SparseWaveform ( const std::string &  name = "")
inline

Creates a new sparse waveform.

Parameters
nameInternal name for this waveform, to be displayed in debug log messages etc

Member Function Documentation

◆ clear()

template<class S >
virtual void SparseWaveform< S >::clear ( )
inlineoverridevirtual

Remove all samples from this waveform.

Implements WaveformBase.

◆ FreeGpuMemory()

template<class S >
virtual void SparseWaveform< S >::FreeGpuMemory ( )
inlineoverridevirtual

Free GPU-side memory if we are short on VRAM or do not anticipate using this waveform for a while.

Implements WaveformBase.

◆ HasGpuBuffer()

template<class S >
virtual bool SparseWaveform< S >::HasGpuBuffer ( )
inlineoverridevirtual

Returns true if we have at least one buffer resident on the GPU.

Implements WaveformBase.

◆ MarkSamplesModifiedFromCpu()

template<class S >
virtual void SparseWaveform< S >::MarkSamplesModifiedFromCpu ( )
inlineoverridevirtual

Indicates that this waveform's sample data has been modified on the CPU and the GPU-side copy is no longer coherent.

Implements WaveformBase.

◆ MarkSamplesModifiedFromGpu()

template<class S >
virtual void SparseWaveform< S >::MarkSamplesModifiedFromGpu ( )
inlineoverridevirtual

Indicates that this waveform's sample data has been modified on the GPU and the CPU-side copy is no longer coherent.

Implements WaveformBase.

◆ PrepareForCpuAccess()

template<class S >
virtual void SparseWaveform< S >::PrepareForCpuAccess ( )
inlineoverridevirtual

Indicates that this waveform is going to be used by the CPU in the near future.

This ensures the CPU-side copy of the data is coherent with the most recently modified (CPU or GPU side) copy.

Implements WaveformBase.

◆ PrepareForGpuAccess()

template<class S >
virtual void SparseWaveform< S >::PrepareForGpuAccess ( )
inlineoverridevirtual

Indicates that this waveform is going to be used by the CPU in the near future.

This ensures the GPU-side copy of the data is coherent with the most recently modified (CPU or GPU side) copy.

Implements WaveformBase.

◆ Rename()

template<class S >
virtual void SparseWaveform< S >::Rename ( const std::string &  name = "")
inlineoverridevirtual

Assings a human readable name to the waveform for debug purposes.

This value may be printed in internal log messages, by the Vulkan validation layers, displayed in frame debuggers, etc.

Implements WaveformBase.

◆ Resize()

template<class S >
virtual void SparseWaveform< S >::Resize ( size_t  size)
inlineoverridevirtual

Reallocates buffers so the waveform contains the specified number of samples.

If the waveform shrinks, excess memory is freed. If the waveform grows, new samples are uninitialized.

Parameters
sizeNew size of the waveform buffer, in samples

Implements WaveformBase.

◆ SetGpuAccessHint()

template<class S >
void SparseWaveform< S >::SetGpuAccessHint ( enum AcceleratorBuffer< S >::UsageHint  hint)
inline

Passes a hint to the memory allocator about where our sample data is expected to be used.

Parameters
hintHint value for expected usage

◆ size()

template<class S >
virtual size_t SparseWaveform< S >::size ( ) const
inlineoverridevirtual

Returns the number of samples in this waveform.

Implements WaveformBase.


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