libptpmgmt  1.4
libptpmgmt library that provides the functionality of linuxptp pmc
Public Member Functions | List of all members
Buf Class Reference

#include <buf.h>

Public Member Functions

 Buf (size_t size)
 
bool alloc (size_t size)
 
void * get () const
 
void * operator() () const
 
size_t size () const
 
bool isAlloc () const
 

Detailed Description

Create memory buffer for use in send, receive, build and parse

Note
This class is for scripts language. C++ code can allocate the buffer directly.

Constructor & Destructor Documentation

◆ Buf()

Buf::Buf ( size_t  size)
inline

Create a new memory buffer

Parameters
[in]sizenew buffer size

Member Function Documentation

◆ alloc()

bool Buf::alloc ( size_t  size)

Create a new memory buffer or resize existing one

Parameters
[in]sizebuffer new size
Returns
true if new buffer allocation success

◆ get()

void* Buf::get ( ) const
inline

Get memory buffer pointer

Returns
memory buffer pointer or null if buffer does not exist

◆ isAlloc()

bool Buf::isAlloc ( ) const
inline

Is memory buffer allocated?

Returns
true if memory buffer is allocated

◆ operator()()

void* Buf::operator() ( ) const
inline

Get memory buffer pointer

Returns
memory buffer pointer or null if buffer does not exist

◆ size()

size_t Buf::size ( ) const
inline

Get memory buffer size

Returns
memory buffer size or 0 if buffer does not exist

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