Pigweed
C/C++ API Reference
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
pw::MultiBufObserver Class Referenceabstract

Public Types

enum class  Event { kBytesAdded , kBytesRemoved , kLayerAdded , kLayerRemoved }
 

Public Member Functions

void Notify (Event event, size_t value)
 Notifies the observer that an event has occurred.
 

Detailed Description

Base class for a subscriber that can be notified when a MultiBuf changes.

As an example, one possible usage is as part of a flow control scheme: An observer tracks how many bytes have been received and added to or removed and sent from one or more MultiBufs. It uses this information to update peers on how much more to send, and to update local tasks how much they may send.

Member Enumeration Documentation

◆ Event

enum class pw::MultiBufObserver::Event
strong

A notification from a MultiBuf.

Each Event is paired with a value with an Event-specifc meaning.

Enumerator
kBytesAdded 

The associated value gives the number of bytes added to the MultiBuf, or added to the top layer if the MultiBuf is layerable.

kBytesRemoved 

The associated value gives the number of bytes removed from the MultiBuf, or removed from the top layer if the MultiBuf is layerable.

kLayerAdded 

The associated value gives the number of fragments in the previous top layer that have been coaleasced into a single fragment in the new top layer.

kLayerRemoved 

The associated value gives the number of fragments in the previous top layer that was removed.


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