ae2f::Core
Loading...
Searching...
No Matches
ae2f::Ds::Alloc::xrOwner Struct Reference

#include <Own.hpp>

Inheritance diagram for ae2f::Ds::Alloc::xrOwner:
ae2f::Ds::Alloc::iOwner< __imp > ae2f::Ds::Arr::__Owner< T, 0 > ae2f::Ds::Arr::__Owner< T, 1 >

Public Member Functions

ae2f_errint_t Read (size_t i, void *dest, size_t destlen) const noexcept
 Gets data from a class.
 
ae2f_errint_t Write (size_t i, const void *src, size_t srclen) noexcept
 Sets data to a class.
 
ae2f_errint_t Length (size_t *lenbuff, size_t *elsizebuff) const noexcept
 Gets the length, and element size of the class.
 
ae2f_errint_t Resize (size_t bytecount) noexcept
 Resizes the memory of [This] as bytes count.
Additional memories(newly allocated) must be initiated as 0.
Element size will be suggested as 1.
 
ae2f_errint_t ReConfig (size_t elcount, size_t elsize)
 Resizes the memory of [This].
Additional memories(newly allocated) must be initiated as 0.
 
 ~xrOwner () noexcept
 Frees the memory of class.
Error code will be stored in ae2f_errGlob_LastErr.
 
ae2f_errint_t Copy (const rRefer &src) noexcept
 Allocates the memory. Copies the data from [src] to a class.
 
ae2f_errint_t Copy (const rRefer &&src) noexcept
 Allocates the memory. Copies the data from [src] to a class.
 
 xrOwner (ae2f_errint_t *perr, const ae2f_ds_vAlloc *imp) noexcept
 Initialises the pointer.
Injects the function pointers automatically.
 

Detailed Description

This structure owns the memory.

An interface to implement the linear array.

See also
ae2f_ds_cAlloc
ae2f_ds_Alloc_cOwn
ae2f::Ds::Alloc::rOwner

Constructor & Destructor Documentation

◆ ~xrOwner()

ae2f::Ds::Alloc::xrOwner::~xrOwner ( )
inlinenoexcept

Frees the memory of class.
Error code will be stored in ae2f_errGlob_LastErr.

Parameters
ThisThe instance of a class where the memory to free is located.
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_PTR_IS_NULL

See also
ae2f_ds_Alloc_cOwn
ae2f_ds_Alloc_fpDel_t
ae2f_ds_Alloc_cOwn_Del
ae2f_errGlob_LastErr

◆ xrOwner()

ae2f::Ds::Alloc::xrOwner::xrOwner ( ae2f_errint_t * perr,
const ae2f_ds_vAlloc * imp )
inlinenoexcept

Initialises the pointer.
Injects the function pointers automatically.

Parameters
perrAn address where state number be stored.
Setting it 0 will cause a status number stored in ae2f_errGlob_LastErr.
impClass Implementations
Returns
ae2f_errGlob_OK
Exceptions

ae2f_ds_Alloc_Err_FPIMPNULL
ae2f_errGlob_PTR_IS_NULL

See also
ae2f_ds_Alloc_cOwn

Member Function Documentation

◆ Copy() [1/2]

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::Copy ( const rRefer && src)
inlinenoexcept

◆ Copy() [2/2]

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::Copy ( const rRefer & src)
inlinenoexcept

◆ Length()

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::Length ( size_t * lenbuff,
size_t * elsizebuff ) const
inlinenoexcept

Gets the length, and element size of the class.

Parameters
lenbuffA pointer where the count of the array, as an unit of elements.
elsizebuffA pointer where the size of the element.
Returns
ae2f_errGlob_OK
ae2f_ds_Alloc_Err_NCOPIED
Exceptions

ae2f_errGlob_PTR_IS_NULL

See also
ae2f_ds_Alloc_cRef
ae2f_ds_Alloc_fpLen_t
ae2f_ds_Alloc_cRef_getSize
ae2f_ds_Alloc_cOwn_getSize

◆ Read()

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::Read ( size_t i,
void * dest,
size_t destlen ) const
inlinenoexcept

Gets data from a class.

Parameters
iThe Index [in an unit of bytes] where the element to copy is.
destA pointer of buffer where the element to be copied.
destlenThe allocated size of the [dest].
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_IMP_NOT_FOUND
ae2f_errGlob_PTR_IS_NULL
ae2f_ds_Alloc_Err_IDX_INVALID

See also
ae2f_ds_Alloc_cRef
ae2f_ds_Alloc_fpRead_t
ae2f_ds_Alloc_cRef_Read
ae2f_ds_Alloc_cOwn_Read

◆ ReConfig()

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::ReConfig ( size_t elcount,
size_t elsize )
inline

Resizes the memory of [This].
Additional memories(newly allocated) must be initiated as 0.

Parameters
elcountThe count of the elements.
elsizeThe size of each elements.
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_PTR_IS_NULL
ae2f_errGlob_ALLOC_FAILED

See also
ae2f_ds_Alloc_cOwn
ae2f_ds_Alloc_fpReConfig_t
ae2f_ds_Alloc_cOwn_ReConfig

◆ Resize()

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::Resize ( size_t bytecount)
inlinenoexcept

Resizes the memory of [This] as bytes count.
Additional memories(newly allocated) must be initiated as 0.
Element size will be suggested as 1.

Warning
This operation may not be efficient under certain implements.
Parameters
bytecountThe byte length to resize.
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_PTR_IS_NULL
ae2f_errGlob_ALLOC_FAILED

See also
ae2f_ds_Alloc_cOwn
ae2f_ds_Alloc_fpReConfig_t
ae2f_ds_Alloc_cOwn_ReConfig
ae2f_ds_Alloc_cOwn_ReSize

◆ Write()

ae2f_errint_t ae2f::Ds::Alloc::xrOwner::Write ( size_t i,
const void * src,
size_t srclen )
inlinenoexcept

Sets data to a class.

Parameters
iThe Index [in an unit of bytes] where the element to be overwritten.
srcA pointer of an element.
srclenAn allocated size of the [src].
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_IMP_NOT_FOUND
ae2f_errGlob_PTR_IS_NULL
ae2f_ds_Alloc_Err_IDX_INVALID

See also
ae2f_ds_Alloc_cRef
ae2f_ds_Alloc_fpWrite_t
ae2f_ds_Alloc_cRef_Write
ae2f_ds_Alloc_cOwn_Write

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