Mana
mana::Buffer Class Referencefinal

#include <Buffer.h>

Inheritance diagram for mana::Buffer:
mana::Noncopyable

Public Member Functions

 Buffer ()
 
 Buffer (const Buffer &)=delete
 
 Buffer (Buffer &&) noexcept=delete
 
Bufferoperator= (const Buffer &)=delete
 
Bufferoperator= (Buffer &&) noexcept=delete
 
 Buffer (const address_t size)
 
 ~Buffer ()=default
 
void Clear ()
 
void Reset ()
 
void Allocate (const address_t size)
 
void Release (const address_t size)
 
template<typename T >
T * GetAddressFromTop (const address_t index) const
 
template<typename T >
T * GetAddressFromBottom (const address_t index) const
 
address_t GetSize () const
 
void SetSize (const address_t size)
 
bool operator== (const Buffer &other) const noexcept
 
bool operator!= (const Buffer &other) const noexcept
 

Detailed Description

frame heap

Constructor & Destructor Documentation

◆ Buffer() [1/4]

mana::Buffer::Buffer ( )
inline

◆ Buffer() [2/4]

mana::Buffer::Buffer ( const Buffer )
delete

◆ Buffer() [3/4]

mana::Buffer::Buffer ( Buffer &&  )
deletenoexcept

◆ Buffer() [4/4]

mana::Buffer::Buffer ( const address_t  size)
inlineexplicit

◆ ~Buffer()

mana::Buffer::~Buffer ( )
default

Member Function Documentation

◆ Allocate()

void mana::Buffer::Allocate ( const address_t  size)
inline

Extend memory block

Parameters
[in]sizeSize to expand memory

◆ Clear()

void mana::Buffer::Clear ( )
inline

Set the size used to 0. No memory is released.

◆ GetAddressFromBottom()

template<typename T >
T * mana::Buffer::GetAddressFromBottom ( const address_t  index) const
inline

Get the address of the specified position from the end

Template Parameters
T
Parameters
[in]indexPosition from the end
Returns
Address of the specified location

◆ GetAddressFromTop()

template<typename T >
T * mana::Buffer::GetAddressFromTop ( const address_t  index) const
inline

Get the address of the specified position from the beginning.

Template Parameters
T
Parameters
[in]indexPosition from the top
Returns
Address of the specified location

◆ GetSize()

address_t mana::Buffer::GetSize ( ) const
inline

Get the size in use.

Returns
Usage size

◆ operator!=()

bool mana::Buffer::operator!= ( const Buffer other) const
inlinenoexcept

Compare contents

Parameters
[in]otherCompare Buffer
Returns
If true, different content

◆ operator=() [1/2]

Buffer& mana::Buffer::operator= ( Buffer &&  )
deletenoexcept

◆ operator=() [2/2]

Buffer& mana::Buffer::operator= ( const Buffer )
delete

◆ operator==()

bool mana::Buffer::operator== ( const Buffer other) const
inlinenoexcept

Compare contents

Parameters
[in]otherCompare Buffer
Returns
If true, same content

◆ Release()

void mana::Buffer::Release ( const address_t  size)
inline

Changes the size of the memory block used. Memory is not released.

Parameters
[in]sizeShrinking size

◆ Reset()

void mana::Buffer::Reset ( )
inline

Set the size used and the size secured to 0.

◆ SetSize()

void mana::Buffer::SetSize ( const address_t  size)
inline

Set the size to be used. Do not set a value greater than the allocated memory block.

Parameters
[in]sizeUsage size

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