Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
ByteBuffer.hxx File Reference
#include "utils/Buffer.hxx"

Go to the source code of this file.

Classes

struct  RawData
 Container for holding an arbitrary untyped data stream. More...
 
struct  ByteChunk
 Holds a reference to a raw buffer, with the start and size information. More...
 

Typedefs

using RawBuffer = Buffer< RawData >
 Buffers of this type will be allocated from the rawBufferPool to hold the payloads of untyped data streams.
 
using RawBufferPtr = BufferPtr< RawData >
 Holds a raw buffer.
 
using ByteBuffer = Buffer< ByteChunk >
 Buffer type of references. These are enqueued for byte sinks.
 
using ByteBufferPtr = BufferPtr< ByteChunk >
 Buffer pointer type for references.
 
using ByteSink = FlowInterface< ByteBuffer >
 Interface for sending a stream of data from a source to a sink.
 

Variables

static constexpr unsigned RAWBUFFER_SIZE = 1024
 This is how many bytes we have in each raw buffer allocation.
 
PoolrawBufferPool
 Use this BufferPool to allocate raw buffers.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Specialization of the Buffer / Pool infrastructure for untyped data stream. See { } Balazs Racz 17 Apr 2022

Definition in file ByteBuffer.hxx.

Typedef Documentation

◆ ByteBuffer

Buffer type of references. These are enqueued for byte sinks.

Definition at line 186 of file ByteBuffer.hxx.

◆ ByteBufferPtr

Buffer pointer type for references.

Definition at line 188 of file ByteBuffer.hxx.

◆ ByteSink

Interface for sending a stream of data from a source to a sink.

Definition at line 193 of file ByteBuffer.hxx.

◆ RawBuffer

Buffers of this type will be allocated from the rawBufferPool to hold the payloads of untyped data streams.

These buffers are never enqueued into Q or QList objects.

Definition at line 58 of file ByteBuffer.hxx.

◆ RawBufferPtr

Holds a raw buffer.

Definition at line 61 of file ByteBuffer.hxx.

Variable Documentation

◆ RAWBUFFER_SIZE

constexpr unsigned RAWBUFFER_SIZE = 1024
staticconstexpr

This is how many bytes we have in each raw buffer allocation.

Definition at line 42 of file ByteBuffer.hxx.

◆ rawBufferPool

Pool* rawBufferPool
extern

Use this BufferPool to allocate raw buffers.

Definition at line 38 of file Buffer.cxx.