Class

PurpleCircularBuffer

since: 3.0

Description [src]

class Purple.CircularBuffer : GObject.Object {
  parent_instance: GObject
}

A circular buffer implementation.

Available since: 3.0

Ancestors

Constructors

purple_circular_buffer_new

Creates a new circular buffer. This will not allocate any memory for the actual buffer until data is appended to it.

since: 3.0

Instance methods

purple_circular_buffer_append

Append data to the PurpleCircularBuffer. This will grow the internal buffer to fit the added data, if needed.

since: 3.0

purple_circular_buffer_get_grow_size

Returns the number of bytes by which the buffer grows when more space is needed.

since: 3.0

purple_circular_buffer_get_max_read

Determine the maximum number of contiguous bytes that can be read from the PurpleCircularBuffer. Note: This may not be the total number of bytes that are buffered - a subsequent call after calling purple_circular_buffer_mark_read() may indicate more data is available to read.

since: 3.0

purple_circular_buffer_get_output

Returns the output pointer of the buffer, where unread data is available. Use purple_circular_buffer_get_max_read() to determine the number of contiguous bytes that can be read from this output. After reading the data, call purple_circular_buffer_mark_read() to mark the retrieved data as read.

since: 3.0

purple_circular_buffer_get_used

Returns the number of bytes of this buffer that contain unread data.

since: 3.0

purple_circular_buffer_grow

Increases the buffer size by a multiple of grow size, so that it can hold at least ‘len’ bytes.

since: 3.0

purple_circular_buffer_mark_read

Mark the number of bytes that have been read from the buffer.

since: 3.0

purple_circular_buffer_reset

Resets the buffer input and output pointers to the start of the buffer.

since: 3.0

Methods inherited from GObject (43)

Please see GObject for a full list of methods.

Properties

Purple.CircularBuffer:buffer-used

How much of the buffer that has been used.

since: 3.0

Purple.CircularBuffer:grow-size

The grow size of the buffer.

since: 3.0

Purple.CircularBuffer:input

The input pointer of the buffer.

since: 3.0

Purple.CircularBuffer:output

The output pointer of the buffer.

since: 3.0

Signals

Signals inherited from GObject (1)
GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct PurpleCircularBufferClass {
  void (* grow) (
    PurpleCircularBuffer* buffer,
    gsize len
  );
  void (* append) (
    PurpleCircularBuffer* buffer,
    gconstpointer src,
    gsize len
  );
  gsize (* max_read_size) (
    PurpleCircularBuffer* buffer
  );
  gboolean (* mark_read) (
    PurpleCircularBuffer* buffer,
    gsize len
  );
  void (* purple_reserved1) (
void
  );
  void (* purple_reserved2) (
void
  );
  void (* purple_reserved3) (
void
  );
  void (* purple_reserved4) (
void
  );
  
}
No description available.
Class members
grow: void (* grow) ( PurpleCircularBuffer* buffer, gsize len )
No description available.
append: void (* append) ( PurpleCircularBuffer* buffer, gconstpointer src, gsize len )
No description available.
max_read_size: gsize (* max_read_size) ( PurpleCircularBuffer* buffer )
No description available.
mark_read: gboolean (* mark_read) ( PurpleCircularBuffer* buffer, gsize len )
No description available.
purple_reserved1: void (* purple_reserved1) ( void )
No description available.
purple_reserved2: void (* purple_reserved2) ( void )
No description available.
purple_reserved3: void (* purple_reserved3) ( void )
No description available.
purple_reserved4: void (* purple_reserved4) ( void )
No description available.

Virtual methods

Purple.CircularBufferClass.append

Append data to the PurpleCircularBuffer. This will grow the internal buffer to fit the added data, if needed.

since: 3.0

Purple.CircularBufferClass.grow

Increases the buffer size by a multiple of grow size, so that it can hold at least ‘len’ bytes.

since: 3.0

Purple.CircularBufferClass.mark_read

Mark the number of bytes that have been read from the buffer.

since: 3.0

Purple.CircularBufferClass.max_read_size
No description available.