A Hopf, Skip and a Jump
Public Member Functions | Friends | List of all members
detectorcache::Segment Class Reference

The producer class enabling a slidingbuffer::SlidingBuffer to be deployed as a cache for the two-dimensional data emerging from a DetectorBank. More...

#include <detectorcache.h>

Inheritance diagram for detectorcache::Segment:
Inheritance graph
[legend]
Collaboration diagram for detectorcache::Segment:
Collaboration graph
[legend]

Public Member Functions

 Segment (const std::size_t size, const std::size_t origin, Producer &sp)
 Construct a segment for use by a slidingbuffer::SlidingBuffer. More...
 
virtual ~Segment ()
 Destroy the Segment and the underlying audio samples in all of the channels which it stores.
 
- Public Member Functions inherited from slidingbuffer::Segment< result_t *, detectorcache::Producer >
 Segment (const std::size_t size, const std::size_t origin, detectorcache::Producer &sp)
 Construct a Segment. More...
 
result_t * & operator[] (std::size_t idx)
 Access an entity, waiting for it to be constructed if deferred construction is still taking place. More...
 
std::size_t get_size (void) const
 Get the Segment's size. More...
 

Friends

class Producer
 

Additional Inherited Members

- Protected Attributes inherited from slidingbuffer::Segment< result_t *, detectorcache::Producer >
result_t * * seg
 Dynamic array of entities in storage.
 
bool valid
 Indicates entities have been constructed (for deferred initialisation: not yet implemented). More...
 
std::size_t size
 Number of entities held.
 
const std::size_t origin
 Index of the first entity in this Segment from the point of view of the SlidingBuffer. More...
 
detectorcache::Producersp
 The producer invoked to fill this Segment.
 

Detailed Description

The producer class enabling a slidingbuffer::SlidingBuffer to be deployed as a cache for the two-dimensional data emerging from a DetectorBank.

Definition at line 138 of file detectorcache.h.

Constructor & Destructor Documentation

◆ Segment()

detectorcache::Segment::Segment ( const std::size_t  size,
const std::size_t  origin,
Producer sp 
)

Construct a segment for use by a slidingbuffer::SlidingBuffer.

Note that the SlidingBuffer entity is in fact a result_t* containing the address of the first result of the channel at the analysis-block sample-time origin. The analysis block is stored in a contiguous 2D array of result values. Conseqently the size parameter in particular refers to the number of channels rather than the number of samples, or number of samples per channel. Refer to the extended documentation for detectorcache::DetectorCache for the bigger picture.

Parameters
sizeNumber of entities in this segment (i.e. the number of channels).
originThe ordinal key of the first channel pointer stored.
spThe producer for this segment.

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