MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FsBuffer Class Reference

#include <FsBuffer.hpp>

Public Member Functions

 FsBuffer ()
const char * setup (Uint32 *Buffer, Uint32 Size, Uint32 BlockSize=128, Uint32 MinRead=1024, Uint32 MaxRead=1024, Uint32 MaxWrite=1024)
const char * valid () const
Uint32 getBufferSize () const
Uint32 getUsableSize () const
Uint32 * getStart () const
bool getReadPtr (Uint32 **ptr, Uint32 *sz, bool *eof)
void updateReadPtr (Uint32 sz)
bool getWritePtr (Uint32 **ptr, Uint32 sz)
void updateWritePtr (Uint32 sz)
void eof ()
Uint32 getMaxWrite () const
Uint32 getMinRead () const
Uint32 getFreeSize () const
void reset ()

Detailed Description

A circular data buffer to be used together with the FS

One writer - Typically your block getWritePtr() updateWritePtr()

One reader - Typically "thread" in your block sending stuff to NDBFS getReadPtr() updateReadPtr()

Definition at line 36 of file FsBuffer.hpp.

Constructor & Destructor Documentation

FsBuffer::FsBuffer ( )
inline

Default constructor

Definition at line 138 of file FsBuffer.hpp.

Member Function Documentation

void FsBuffer::eof ( )
inline

There will be no more writing to this buffer

Definition at line 358 of file FsBuffer.hpp.

Uint32 FsBuffer::getMaxWrite ( ) const
inline

Getters for varibles

Definition at line 108 of file FsBuffer.hpp.

Here is the caller graph for this function:

bool FsBuffer::getReadPtr ( Uint32 **  ptr,
Uint32 *  sz,
bool *  eof 
)
inline

getReadPtr - Get pointer and size of data to send to FS

Parameters
ptr- Where to fetch data
sz- How much data in 32-bit words
eof- Is this the last fetch (only if return false)
Returns
true - If there is data of size >= minread false - If there is can be data be if it is is < minread
  • else eof = true

Definition at line 255 of file FsBuffer.hpp.

Here is the caller graph for this function:

bool FsBuffer::getWritePtr ( Uint32 **  ptr,
Uint32  sz 
)
inline
Note
Must be followed by a updateWritePtr(no of words used)

Definition at line 313 of file FsBuffer.hpp.

Here is the caller graph for this function:

void FsBuffer::reset ( void  )
inline

reset

Definition at line 215 of file FsBuffer.hpp.

const char * FsBuffer::setup ( Uint32 *  Buffer,
Uint32  Size,
Uint32  BlockSize = 128,
Uint32  MinRead = 1024,
Uint32  MaxRead = 1024,
Uint32  MaxWrite = 1024 
)
inline

setup FsBuffer

Parameters
Buffer- Ptr to continuous memory
Size- Buffer size in 32-bit words
BlockSize- Size of block in 32-bit words
MinRead- Min read size in 32-bit words Get rounded(down) to nearest multiple of block size.
MaxRead- Max read size in 32-bit words Get rounded(down) to nearest multiple of block size.
MaxWrite- Maximum write (into buffer) in 32-bit words
Returns
NULL if everything is OK else A string describing problem

Definition at line 166 of file FsBuffer.hpp.

void FsBuffer::updateReadPtr ( Uint32  sz)
inline
Note
: sz must be equal to sz returned by getReadPtr

Definition at line 303 of file FsBuffer.hpp.


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