API Documentation
Loading...
Searching...
No Matches
BufferAllocator< t_type, t_index_type, t_null_term > Class Template Reference

#include <MemoryManager.h>

Public Member Functions

constexpr BufferAllocator ()
 
constexpr BufferAllocator (BufferAllocator &&allocator) noexcept
 
 ~BufferAllocator ()
 
template<bool t_managed>
void createSpace (t_index_type size)
 
template<bool t_managed>
void createSpace (t_index_type location, t_index_type size)
 
void addLast ()
 
void removeLast ()
 
t_index_type count (const t_type &value) const
 
void addIndex ()
 
void addIndex (t_index_type location)
 
void removeIndex (t_index_type location)
 
sint04 compare (const BufferAllocator &allocator) const
 
sint04 compare (const BufferAllocator &allocator, t_index_type start, t_index_type end) const
 
void swap (t_index_type index_a, t_index_type index_b)
 
void clear ()
 
void setSize (t_index_type size)
 
t_type & get (t_index_type index)
 
const t_type & get (t_index_type index) const
 
t_type * ptr ()
 
const t_type * ptr () const
 
t_index_type memSize () const
 
t_type * begin ()
 
const t_type * begin () const
 
t_type * begin (t_index_type index) const
 
t_index_type capacity () const
 
t_type * end ()
 
const t_type * end () const
 
t_type * end (t_index_type index)
 
void resizeSpace (t_index_type new_size)
 
void setAll (const t_type &object, t_index_type offset, t_index_type size)
 
template<bool is_primitive>
void setAll (const t_type *src, t_index_type offset, t_index_type size)
 
template<bool is_primitive, class t_other_index_type , bool t_other_null_term>
void setAll (const BufferAllocator< t_type, t_other_index_type, t_other_null_term > &allocator, t_index_type offset, t_index_type other_offset, t_index_type size)
 
template<class t_other_allocator >
void setAllFromSource (const t_other_allocator &allocator, t_index_type offset, t_index_type other_offset, t_index_type size)
 
template<bool t_managed>
void allocationSizeCheck ()
 
void removeAllIndex (t_index_type start, t_index_type end)
 
template<class t_range_buffer >
void removeAllIndices (const t_range_buffer &ranges)
 
template<bool t_is_null>
void nullTerminatorCheck ()
 
template<bool t_is_null>
t_type * emptyPtr () const
 
constexpr t_index_type filledSize () const
 
BufferAllocatoroperator= (BufferAllocator &&value) noexcept
 

Static Public Member Functions

static constexpr bool IsNullTerm ()
 

Public Attributes

t_type * m_buffer
 
t_index_type m_filled_size
 
t_index_type m_allocated_size
 

Detailed Description

template<class t_type, class t_index_type, bool t_null_term>
class NDEVR::BufferAllocator< t_type, t_index_type, t_null_term >

Class: BufferAllocator

A buffer allocator.

Author: Tyler Parke

Date: 2017-11-19

Constructor & Destructor Documentation

◆ BufferAllocator() [1/2]

template<class t_type , class t_index_type , bool t_null_term>
BufferAllocator ( )
inlineexplicitconstexpr

◆ BufferAllocator() [2/2]

template<class t_type , class t_index_type , bool t_null_term>
BufferAllocator ( BufferAllocator< t_type, t_index_type, t_null_term > && allocator)
inlineconstexprnoexcept

◆ ~BufferAllocator()

template<class t_type , class t_index_type , bool t_null_term>
~BufferAllocator ( )
inline

Fn: BufferAllocator::~BufferAllocator()

Destructor.

Author: Tyler Parke

Date: 2017-11-19

Member Function Documentation

◆ addIndex() [1/2]

template<class t_type , class t_index_type , bool t_null_term>
void addIndex ( )
inline

Fn: void BufferAllocator::addIndex()

Adds index.

Author: Tyler Parke

Date: 2017-11-19

◆ addIndex() [2/2]

template<class t_type , class t_index_type , bool t_null_term>
void addIndex ( t_index_type location)
inline

Fn: void BufferAllocator::addIndex(t_index_type location)

Adds an index.

Author: Tyler Parke

Date: 2017-11-19

Parameters:

location - The location.

◆ addLast()

template<class t_type , class t_index_type , bool t_null_term>
void addLast ( )
inline

Fn: void BufferAllocator::addLast()

Adds last.

Author: Tyler Parke

Date: 2017-11-19

◆ allocationSizeCheck()

template<class t_type , class t_index_type , bool t_null_term>
template<bool t_managed>
void allocationSizeCheck ( )
inline

Fn: inline void BufferAllocator::allocationSizeCheck()

Allocation size check.

Author: Tyler Parke

Date: 2017-11-19

◆ begin() [1/3]

template<class t_type , class t_index_type , bool t_null_term>
t_type * begin ( )
inlinenodiscard

Fn: t_type* BufferAllocator::begin()

Gets the begin.

Author: Tyler Parke

Date: 2017-11-19

Returns: Null if it fails, else a pointer to a t_type.

◆ begin() [2/3]

template<class t_type , class t_index_type , bool t_null_term>
const t_type * begin ( ) const
inlinenodiscard

Fn: const t_type* BufferAllocator::begin() const

Gets the begin.

Author: Tyler Parke

Date: 2017-11-19

Returns: Null if it fails, else a pointer to a const t_type.

◆ begin() [3/3]

template<class t_type , class t_index_type , bool t_null_term>
t_type * begin ( t_index_type index) const
inlinenodiscard

Fn: t_type* BufferAllocator::begin(t_index_type index) const

Begins the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - Zero-based index of the.

Returns: Null if it fails, else a pointer to a t_type.

◆ capacity()

template<class t_type , class t_index_type , bool t_null_term>
t_index_type capacity ( ) const
inlinenodiscard

Fn: t_index_type BufferAllocator::capacity() const

Gets the capacity of the buffer or total space allocated to it.

Author: Tyler Parke

Date: 2017-04-15

Returns: The capacity of the current allocated buffer.

◆ clear()

template<class t_type , class t_index_type , bool t_null_term>
void clear ( )
inline

Fn: void BufferAllocator::clear()

Clears this object to its blank/initial state.

Author: Tyler Parke

Date: 2017-11-19

◆ compare() [1/2]

template<class t_type , class t_index_type , bool t_null_term>
sint04 compare ( const BufferAllocator< t_type, t_index_type, t_null_term > & allocator) const
inlinenodiscard

Fn: sint04 BufferAllocator::compare(const BufferAllocator& allocator) const

Compares this const BufferAllocator& object to another to determine their relative ordering.

Author: Tyler Parke

Date: 2017-11-19

Parameters: allocator - The constant buffer allocator& to compare to this object.

Returns: Negative if 'allocator' is less than '', 0 if they are equal, or positive if it is

greater.

◆ compare() [2/2]

template<class t_type , class t_index_type , bool t_null_term>
sint04 compare ( const BufferAllocator< t_type, t_index_type, t_null_term > & allocator,
t_index_type start,
t_index_type end ) const
inlinenodiscard

Fn: sint04 BufferAllocator::compare(const BufferAllocator& allocator, t_index_type start, t_index_type end) const

Compares objects.

Author: Tyler Parke

Date: 2017-11-19

Parameters: allocator - Constant buffer allocator& to be compared. start - Uint 04 to be compared. end - Uint 04 to be compared.

Returns: Negative if 'allocator' is less than 'start', 0 if they are equal, or positive if it is

greater.

◆ count()

template<class t_type , class t_index_type , bool t_null_term>
t_index_type count ( const t_type & value) const
inlinenodiscard

Fn: t_index_type BufferAllocator::count(const t_type& value) const

Counts the given value.

Author: Tyler Parke

Date: 2017-11-19

Parameters: value - The value.

Returns: An t_index_type.

◆ createSpace() [1/2]

template<class t_type , class t_index_type , bool t_null_term>
template<bool t_managed>
void createSpace ( t_index_type location,
t_index_type size )
inline

Fn: void BufferAllocator::createSpace(t_index_type location, t_index_type size)

Creates a space.

Author: Tyler Parke

Date: 2017-11-19

Parameters: location - The location.

size - The size.

◆ createSpace() [2/2]

template<class t_type , class t_index_type , bool t_null_term>
template<bool t_managed>
void createSpace ( t_index_type size)
inline

Fn: void BufferAllocator::createSpace(t_index_type size)

Creates a space.

Author: Tyler Parke

Date: 2017-11-19

Parameters:

size - The size.

◆ emptyPtr()

template<class t_type , class t_index_type , bool t_null_term>
template<bool t_is_null>
t_type * emptyPtr ( ) const
inlinenodiscard

Fn: template<bool t_is_null> inline void BufferAllocator::nullTerminatorCheck();

Null terminator check.

Author: Tyler Parke

Date: 2017-11-19

Typeparams:

t_is_null - Type of the is null.

◆ end() [1/3]

template<class t_type , class t_index_type , bool t_null_term>
t_type * end ( )
inlinenodiscard

Fn: t_type* BufferAllocator::end()

Gets the end.

Author: Tyler Parke

Date: 2017-11-19

Returns: Null if it fails, else a pointer to a t_type.

◆ end() [2/3]

template<class t_type , class t_index_type , bool t_null_term>
const t_type * end ( ) const
inlinenodiscard

Fn: const t_type* BufferAllocator::end() const

Gets the end.

Author: Tyler Parke

Date: 2017-11-19

Returns: Null if it fails, else a pointer to a const t_type.

◆ end() [3/3]

template<class t_type , class t_index_type , bool t_null_term>
t_type * end ( t_index_type index)
inline

Fn: t_type* BufferAllocator::end(t_index_type index)

Ends the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - Zero-based index of the.

Returns: Null if it fails, else a pointer to a t_type.

◆ filledSize()

template<class t_type , class t_index_type , bool t_null_term>
t_index_type filledSize ( ) const
inlinenodiscardconstexpr

Fn: t_index_type BufferAllocator::filledSize() const

Filled size.

Author: Tyler Parke

Date: 2017-11-19

Returns: An t_index_type.

◆ get() [1/2]

template<class t_type , class t_index_type , bool t_null_term>
t_type & get ( t_index_type index)
inline

Fn: t_type& BufferAllocator::get(t_index_type index)

Gets a t type& using the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - The index to get.

Returns: A reference to a t_type.

◆ get() [2/2]

template<class t_type , class t_index_type , bool t_null_term>
const t_type & get ( t_index_type index) const
inlinenodiscard

Fn: const t_type& BufferAllocator::get(t_index_type index) const

Gets a constant type& using the given index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index - The index to get.

Returns: A reference to a const t_type.

◆ IsNullTerm()

template<class t_type , class t_index_type , bool t_null_term>
static constexpr bool IsNullTerm ( )
inlinestaticnodiscardconstexpr

◆ memSize()

template<class t_type , class t_index_type , bool t_null_term>
t_index_type memSize ( ) const
inlinenodiscard

◆ nullTerminatorCheck()

template<class t_type , class t_index_type , bool t_null_term>
template<bool t_is_null>
void nullTerminatorCheck ( )
inline

Fn: template<bool t_is_null> inline void BufferAllocator::nullTerminatorCheck();

Null terminator check.

Author: Tyler Parke

Date: 2017-11-19

Typeparams:

t_is_null - Type of the is null.

◆ operator=()

template<class t_type , class t_index_type , bool t_null_term>
BufferAllocator & operator= ( BufferAllocator< t_type, t_index_type, t_null_term > && value)
inlinenoexcept

Fn: inline BufferAllocator& BufferAllocator::operator=(BufferAllocator&& value)

Move assignment operator.

Author: Tyler Parke

Date: 2017-11-19

Parameters: value - [in,out] The value.

Returns: A shallow copy of this object.

◆ ptr() [1/2]

template<class t_type , class t_index_type , bool t_null_term>
t_type * ptr ( )
inline

◆ ptr() [2/2]

template<class t_type , class t_index_type , bool t_null_term>
const t_type * ptr ( ) const
inlinenodiscard

◆ removeAllIndex()

template<class t_type , class t_index_type , bool t_null_term>
void removeAllIndex ( t_index_type start,
t_index_type end )
inline

Fn: void BufferAllocator::removeAllIndex(t_index_type start, t_index_type end)

Removes all index.

Author: Tyler Parke

Date: 2017-11-19

Parameters: start - The start.

end - The end.

◆ removeAllIndices()

template<class t_type , class t_index_type , bool t_null_term>
template<class t_range_buffer >
void removeAllIndices ( const t_range_buffer & ranges)
inline

◆ removeIndex()

template<class t_type , class t_index_type , bool t_null_term>
void removeIndex ( t_index_type location)
inline

Fn: void BufferAllocator::removeIndex(t_index_type location)

Removes the index described by location.

Author: Tyler Parke

Date: 2017-11-19

Parameters:

location - The location.

◆ removeLast()

template<class t_type , class t_index_type , bool t_null_term>
void removeLast ( )
inline

Fn: void BufferAllocator::removeLast()

Removes the last.

Author: Tyler Parke

Date: 2017-11-19

◆ resizeSpace()

template<class t_type , class t_index_type , bool t_null_term>
void resizeSpace ( t_index_type new_size)
inline

Fn: inline void BufferAllocator::resizeSpace(t_index_type new_size)

Resize space.

Author: Tyler Parke

Date: 2017-11-19

Parameters:

new_size - Size of the new.

◆ setAll() [1/3]

template<class t_type , class t_index_type , bool t_null_term>
template<bool is_primitive, class t_other_index_type , bool t_other_null_term>
void setAll ( const BufferAllocator< t_type, t_other_index_type, t_other_null_term > & allocator,
t_index_type offset,
t_index_type other_offset,
t_index_type size )
inline

Fn: void BufferAllocator::setAll<true>(const t_type* src, t_index_type offset, t_index_type size)

Sets all.

Author: Tyler Parke

Date: 2017-11-19

Typeparams: true - Type of the true. Parameters: src - Source for the. offset - The offset.

size - The size.


Fn: void BufferAllocator::setAll<false>(const t_type* src, t_index_type offset, t_index_type size)

Sets all.

Author: Tyler Parke

Date: 2017-11-19

Typeparams: false - Type of the false. Parameters: src - Source for the. offset - The offset.

size - The size.


Fn: template<bool is_primitive> void BufferAllocator::setAll(const BufferAllocator& allocator, t_index_type offset, t_index_type other_offset, t_index_type size);

Sets all.

Author: Tyler Parke

Date: 2017-11-19

Typeparams: is_primitive - Type of the is primitive. Parameters: allocator - The allocator. offset - The offset. other_offset - The other offset.

size - The size.

◆ setAll() [2/3]

template<class t_type , class t_index_type , bool t_null_term>
void setAll ( const t_type & object,
t_index_type offset,
t_index_type size )
inline

Fn: void BufferAllocator::setAll(const t_type& object, t_index_type offset, t_index_type size)

Sets all.

Author: Tyler Parke

Date: 2017-11-19

Parameters: object - The object. offset - The offset.

size - The size.

◆ setAll() [3/3]

template<class t_type , class t_index_type , bool t_null_term>
template<bool is_primitive>
void setAll ( const t_type * src,
t_index_type offset,
t_index_type size )
inline

Fn: template<bool is_primitive> void BufferAllocator::setAll(const t_type* src, t_index_type offset, t_index_type size);

Sets all.

Author: Tyler Parke

Date: 2017-11-19

Typeparams: is_primitive - Type of the is primitive. Parameters: src - Source for the. offset - The offset.

size - The size.

◆ setAllFromSource()

template<class t_type , class t_index_type , bool t_null_term>
template<class t_other_allocator >
void setAllFromSource ( const t_other_allocator & allocator,
t_index_type offset,
t_index_type other_offset,
t_index_type size )
inline

Fn: void BufferAllocator::setAllFromSource(const t_other_allocator& allocator, t_index_type offset, t_index_type other_offset, t_index_type size)

Sets all from source.

Author: Tyler Parke

Date: 2017-11-19

Parameters: allocator - The allocator. offset - The offset. other_offset - The other offset.

size - The size.

◆ setSize()

template<class t_type , class t_index_type , bool t_null_term>
void setSize ( t_index_type size)
inline

Fn: void BufferAllocator::setSize(t_index_type size)

Sets a size.

Author: Tyler Parke

Date: 2017-11-19

Parameters:

size - The size.

◆ swap()

template<class t_type , class t_index_type , bool t_null_term>
void swap ( t_index_type index_a,
t_index_type index_b )
inline

Fn: void BufferAllocator::swap(t_index_type index_a, t_index_type index_b)

Swaps.

Author: Tyler Parke

Date: 2017-11-19

Parameters: index_a - The index a.

index_b - The index b.

Member Data Documentation

◆ m_allocated_size

template<class t_type , class t_index_type , bool t_null_term>
t_index_type m_allocated_size

◆ m_buffer

template<class t_type , class t_index_type , bool t_null_term>
t_type* m_buffer

The buffer that stores the actual data.

◆ m_filled_size

template<class t_type , class t_index_type , bool t_null_term>
t_index_type m_filled_size

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