Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.assist_pipeline.ring_buffer.RingBuffer Class Reference

Public Member Functions

None __init__ (self, int maxlen)
 
int __len__ (self)
 
bytes getvalue (self)
 
int maxlen (self)
 
int pos (self)
 
None put (self, bytes data)
 

Private Attributes

 _buffer
 
 _length
 
 _maxlen
 
 _pos
 

Detailed Description

Basic ring buffer using a bytearray.

Not threadsafe.

Definition at line 4 of file ring_buffer.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.assist_pipeline.ring_buffer.RingBuffer.__init__ (   self,
int  maxlen 
)
Initialize empty buffer.

Definition at line 10 of file ring_buffer.py.

Member Function Documentation

◆ __len__()

int homeassistant.components.assist_pipeline.ring_buffer.RingBuffer.__len__ (   self)
Return the length of data stored in the buffer.

Definition at line 27 of file ring_buffer.py.

◆ getvalue()

bytes homeassistant.components.assist_pipeline.ring_buffer.RingBuffer.getvalue (   self)
Get bytes written to the buffer.

Definition at line 50 of file ring_buffer.py.

◆ maxlen()

int homeassistant.components.assist_pipeline.ring_buffer.RingBuffer.maxlen (   self)
Return the maximum size of the buffer.

Definition at line 18 of file ring_buffer.py.

◆ pos()

int homeassistant.components.assist_pipeline.ring_buffer.RingBuffer.pos (   self)
Return the current put position.

Definition at line 23 of file ring_buffer.py.

◆ put()

None homeassistant.components.assist_pipeline.ring_buffer.RingBuffer.put (   self,
bytes  data 
)
Put a chunk of data into the buffer, possibly wrapping around.

Definition at line 31 of file ring_buffer.py.

Member Data Documentation

◆ _buffer

homeassistant.components.assist_pipeline.ring_buffer.RingBuffer._buffer
private

Definition at line 12 of file ring_buffer.py.

◆ _length

homeassistant.components.assist_pipeline.ring_buffer.RingBuffer._length
private

Definition at line 14 of file ring_buffer.py.

◆ _maxlen

homeassistant.components.assist_pipeline.ring_buffer.RingBuffer._maxlen
private

Definition at line 15 of file ring_buffer.py.

◆ _pos

homeassistant.components.assist_pipeline.ring_buffer.RingBuffer._pos
private

Definition at line 13 of file ring_buffer.py.


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