ost::FixedBuffer(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::FixedBuffer πŸ’–

okay bestie, welcome to the ost::FixedBuffer page from the GNU CommonC++ Library Functions Manual, section 3. yes this is a C++ class page, no we are not scared, we are thriving πŸ¦‹


✨ NAME ✨

ost::FixedBuffer β€” a buffer class that holds a known capacity of fixed sized objects defined during creation. that's it, that's the whole vibe. it's giving "container with boundaries" πŸ’…


🌸 SYNOPSIS 🌸

#include <buffer.h>

Inherits ost::Buffer. so it's a nepo baby but in a cute way, it gets stuff from its parent 🫢

πŸ‘‘ Public Member Functions

  • FixedBuffer (size_t capacity, size_t objsize) β€” create a buffer of known capacity for objects of a specified size.
  • FixedBuffer (const FixedBuffer &fb) β€” create a copy of an existing fixed size buffer and duplicate its contents. twin moment fr fr.
  • virtual ~FixedBuffer () β€” destroy the fixed buffer and free the memory used to store objects. rest in peace queen πŸ’€
  • FixedBuffer & operator= (const FixedBuffer &fb) β€” the assignment operator, doing its copy thing.
  • bool isValid (void) β€” checks if it's valid, we love a self-aware icon.

🧚 Protected Member Functions

  • size_t onPeek (void *buf) β€” return the first object in the buffer.
  • size_t onWait (void *buf) β€” wait for and return a fixed object in the buffer.
  • size_t onPost (void *buf) β€” post an object of the appropriate size into the buffer.

🌈 Additional Inherited Members

yep, there's more stuff it inherited from ost::Buffer. no cap, it comes with the family package.


πŸ’œ Detailed Description πŸ’œ

A buffer class that holds a known capacity of fixed sized objects defined during creation. so you tell it up front "this is how many" and "this is how big each one is" and it simply respects that. boundaries, bestie, we love to see it ✨

Author David Sugar dyfet@ostel.com

producer/consumer buffer for fixed size objects. that's the whole job description and she does it flawlessly πŸŽ€


πŸ“ Constructor & Destructor Documentation πŸ“

ost::FixedBuffer::FixedBuffer (size_t capacity, size_t objsize)

Create a buffer of known capacity for objects of a specified size.

Parameters

  • capacity of the buffer. like, how many can fit in here.
  • objsize for each object held in the buffer. how chunky is each one.

ost::FixedBuffer::FixedBuffer (const FixedBuffer & fb)

Create a copy of an existing fixed size buffer and duplicate its contents. a full glow-up clone, contents included πŸ”₯

Parameters

  • fb existing FixedBuffer object. the original, the blueprint, the moment.

virtual ost::FixedBuffer::~FixedBuffer () [virtual]

Destroy the fixed buffer and free the memory used to store objects. she's done, she's freeing everything on her way out, iconic exit πŸ’…


πŸ¦‹ Member Function Documentation πŸ¦‹

bool ost::FixedBuffer::isValid (void) [virtual]

Reimplemented from ost::Buffer. so she took the parent's version and made it her own, main character energy πŸ‘‘

size_t ost::FixedBuffer::onPeek (void * buf) [protected], [virtual]

Return the first object in the buffer. just a little look, no take, no cap πŸ™ˆ

Returns predefined size of this buffers objects.

Parameters

  • buf pointer to copy contents of head of buffer to.

Implements ost::Buffer.

size_t ost::FixedBuffer::onPost (void * buf) [protected], [virtual]

Post an object of the appropriate size into the buffer. dropping it in, right size, right place ✨

Returns predefined size of this buffers objects.

Parameters

  • buf pointer to data to copy into the buffer.

Implements ost::Buffer.

size_t ost::FixedBuffer::onWait (void * buf) [protected], [virtual]

Wait for and return a fixed object in the buffer. patiently waiting for her turn, and then she delivers 🫢

Returns predefined size of this buffers objects.

Parameters

  • buf pointer to hold object returned from the buffer.

Implements ost::Buffer.

FixedBuffer& ost::FixedBuffer::operator= (const FixedBuffer & fb)

the assignment operator, taking another FixedBuffer and copying its whole deal over here. copy-paste but make it classy πŸ’–


⭐ Author ⭐

Generated automatically by Doxygen for GNU CommonC++ from the source code. so technically a robot wrote this and we're just out here adding the sparkle 🌟


and that's the whole page bestie, you ate it, you understood it, periodt πŸ’…βœ¨

GNU CommonC++ β€” Sun Dec 27 2020 β€” ost::FixedBuffer(3). mwah, love you, go read buffer.h πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from