expyriment.misc.ByteBuffer

class expyriment.misc.ByteBuffer(name='ByteBuffer', clock=None)

A class implementing a buffer for bytes.

The ByteBuffer class is also used for the input_histoy of serial and parallel ports.

Methods

__init__(name='ByteBuffer', clock=None)

Create a buffer for bytes.

Parameters name – the name of the buffer (str) clock – an experimental clock (expyriment.Clock object) (optional)

add_event(event)

Add an event to the buffer.

Parameters event – the event to add (anything)

add_events(events)

Add a list of events to the buffer.

All events get the same time stamp!

Parameters events – the event list to add (list)

check_set(search_byte, search_start_position=0)

Check if bits are set in buffer bytes and return position.

Parameters search_byte – the byte to search for (int) search_start_position – position to start search from (int)

(optional)
check_unset(search_byte, search_start_position=0)

Check if bits are NOT set in buffer bytes and return position.

Parameters search_byte – the byte to search for (int) search_start_position – position to start search from (int)

(optional)
check_value(value, search_start_position=0)

Check if value is in buffer bytes and return the position.

Parameters value – the value to check (int) search_start_position – position to start search from (int)

(optional)
clear()

Clear the buffer.

clock

Getter for clock

get_element(position)

Get an element (code, rt) from the buffer.

Parameters position – the position to get the element from (int)

get_last_event()

Get the last event (code, rt) in the buffer.

get_size()

Return the number of elements in the buffer.

get_whole_buffer()

Get a copy of the buffer.

memory

Getter for memory [list of tuples (code, rt)]

name

Getter for name

Previous topic

expyriment.misc.Buffer

Next topic

expyriment.misc.Clock

This Page