ae2f::Core
Loading...
Searching...
No Matches
Own.h File Reference

Go to the source code of this file.

Macros

#define ae2f_ds_Alloc_cOwn   ae2f_ds_cAlloc
 
#define ae2f_ds_Alloc_cOwn_InitAuto(This)
 Initialises the pointer.
Injects the function pointers automatically.
 
#define ae2f_ds_Alloc_cOwn_Cpy(This, Source)
 Allocates the memory. Copies the data from [Source] to [This].
 
#define ae2f_ds_Alloc_cOwn_getSize   ae2f_ds_Alloc_cRef_getSize
 Gets the length, and element size of the class.
 
#define ae2f_ds_Alloc_cOwn_Read   ae2f_ds_Alloc_cRef_Read
 Gets data from a class.
 
#define ae2f_ds_Alloc_cOwn_Write   ae2f_ds_Alloc_cRef_Write
 Sets data to a class.
 
#define ae2f_ds_Alloc_cOwn_Del(This)
 Frees the memory of [This].
 
#define ae2f_ds_Alloc_cOwn_ReConfig(This, elcount, elsize)
 Resizes the memory of [This].
Additional memories(newly allocated) must be initiated as 0.
 
#define ae2f_ds_Alloc_cOwn_ReSize(This, bytecount)
 Resizes the memory of [This] as bytes count.
Additional memories(newly allocated) must be initiated as 0.
Element size will be suggested as 1.
 

Typedefs

typedef ae2f_errint_t(* ae2f_ds_Alloc_fpDel_t) (ae2f_struct ae2f_ds_Alloc_cOwn *_this)
 Frees the memory of _this.
 
typedef ae2f_errint_t(* ae2f_ds_Alloc_fpReConfig_t) (ae2f_struct ae2f_ds_Alloc_cOwn *_this, size_t elcount, size_t elsize)
 Resizes the memory of _this.
Additional memories(newly allocated) must be initiated as 0.
 

Functions

ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Alloc_cOwn_Init (ae2f_struct ae2f_ds_Alloc_cOwn *This, const ae2f_struct ae2f_ds_vAlloc *imp)
 Initialises the pointer.
Injects the function pointers automatically.
 
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Alloc_cOwn_Cpy_imp (ae2f_struct ae2f_ds_Alloc_cOwn *This, const ae2f_struct ae2f_ds_cAlloc *Source)
 Allocates the memory. Copies the data from [Source] to [This].
 

Detailed Description

Warning
This file is a helper header of ae2f/Ds/Alloc.h
Few definitions may lack.

Macro Definition Documentation

◆ ae2f_ds_Alloc_cOwn

#define ae2f_ds_Alloc_cOwn   ae2f_ds_cAlloc

This structure owns the memory.

See also
ae2f_ds_cAlloc

◆ ae2f_ds_Alloc_cOwn_Cpy

#define ae2f_ds_Alloc_cOwn_Cpy ( This,
Source )
Value:
#define ae2f_struct
In C, keyword 'struct' must be written in front of the structure's name in order to use as a type nam...
Definition Cast.h:81
#define ae2f_reinterpret_cast(t, v)
Definition Cast.h:57
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Alloc_cOwn_Cpy_imp(ae2f_struct ae2f_ds_Alloc_cOwn *This, const ae2f_struct ae2f_ds_cAlloc *Source)
Allocates the memory. Copies the data from [Source] to [This].
The data holder for [cRef] and [cOwn].
Definition Alloc.h:39

Allocates the memory. Copies the data from [Source] to [This].

Parameters
ThisPoints the allocated memory.
SourceSource to copy.
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_PTR_IS_NULL
ae2f_errGlob_ALLOC_FAILED

See also
ae2f_ds_Alloc_cRef_getSize
ae2f_ds_Alloc_cRef_Read
ae2f_ds_Alloc_cRef_Write
ae2f_ds_Alloc_cOwn
ae2f_ds_Alloc_cOwn_ReConfig
ae2f_ds_Alloc_cOwn_Cpy_imp

◆ ae2f_ds_Alloc_cOwn_Del

#define ae2f_ds_Alloc_cOwn_Del ( This)
Value:
#define _ae2f_ds_Alloc_CallVoid(This, Name)
Definition Alloc.h:76

Frees the memory of [This].

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_getSize

#define ae2f_ds_Alloc_cOwn_getSize   ae2f_ds_Alloc_cRef_getSize

Gets the length, and element size of the class.

Parameters
_thisThe constant instance of the class.
pSizeA pointer where the count of the array, as an unit of elements.
pelA 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_InitAuto

#define ae2f_ds_Alloc_cOwn_InitAuto ( This)
Value:
ae2f_SHAREDCALL ae2f_extern const ae2f_struct ae2f_ds_vAlloc ae2f_ds_vAlloc_cLinear
Each elements will be physically linear.
Definition Alloc.h:30
ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Alloc_cOwn_Init(ae2f_struct ae2f_ds_Alloc_cOwn *This, const ae2f_struct ae2f_ds_vAlloc *imp)
Initialises the pointer. Injects the function pointers automatically.

Initialises the pointer.
Injects the function pointers automatically.

Parameters
ThisAddress to be set.
Do not pass when it is allocated.
impClass Implementations
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_PTR_IS_NULL

See also
ae2f_ds_Alloc_cOwn
ae2f_ds_Alloc_cOwn_Init

◆ ae2f_ds_Alloc_cOwn_Read

#define ae2f_ds_Alloc_cOwn_Read   ae2f_ds_Alloc_cRef_Read

Gets data from a class.

Parameters
ThisThe constant instance of the class.
idxThe Index [in an unit of bytes] where the element to copy is.
buffA pointer of buffer where the element to be copied.
elsizeThe allocated size of the [buff].
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_ReConfig

#define ae2f_ds_Alloc_cOwn_ReConfig ( This,
elcount,
elsize )
Value:
_ae2f_ds_Alloc_Call(This, ReConfig, elcount, elsize)
#define _ae2f_ds_Alloc_Call(This, Name,...)
Definition Alloc.h:65

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

Parameters
ThisThe owner of the memory.
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_ReSize

#define ae2f_ds_Alloc_cOwn_ReSize ( This,
bytecount )
Value:
ae2f_ds_Alloc_cOwn_ReConfig(This, bytecount, 1)
#define ae2f_ds_Alloc_cOwn_ReConfig(This, elcount, elsize)
Resizes the memory of [This]. Additional memories(newly allocated) must be initiated as 0.
Definition Own.h:191

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
ThisThe owner of the memory.
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_Write

#define ae2f_ds_Alloc_cOwn_Write   ae2f_ds_Alloc_cRef_Write

Sets data to a class.

Parameters
ThisThe instance of the class.
idxThe Index [in an unit of bytes] where the element to be overwritten.
srcA pointer of an element.
srcsizeAn 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

Typedef Documentation

◆ ae2f_ds_Alloc_fpDel_t

typedef ae2f_errint_t(* ae2f_ds_Alloc_fpDel_t) (ae2f_struct ae2f_ds_Alloc_cOwn *_this)

Frees the memory of _this.

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_fpReConfig_t

typedef ae2f_errint_t(* ae2f_ds_Alloc_fpReConfig_t) (ae2f_struct ae2f_ds_Alloc_cOwn *_this, size_t elcount, size_t elsize)

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

Parameters
_thisThe owner of the memory.
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

Function Documentation

◆ ae2f_ds_Alloc_cOwn_Cpy_imp()

ae2f_SHAREDCALL ae2f_extern ae2f_errint_t ae2f_ds_Alloc_cOwn_Cpy_imp ( ae2f_struct ae2f_ds_Alloc_cOwn * This,
const ae2f_struct ae2f_ds_cAlloc * Source )

Allocates the memory. Copies the data from [Source] to [This].

Parameters
ThisPoints the allocated memory.
SourceSource to copy.
Returns
ae2f_errGlob_OK
Exceptions

ae2f_errGlob_PTR_IS_NULL
ae2f_errGlob_ALLOC_FAILED

See also
ae2f_ds_Alloc_cRef_getSize
ae2f_ds_Alloc_cRef_Read
ae2f_ds_Alloc_cRef_Write
ae2f_ds_Alloc_cOwn
ae2f_ds_Alloc_cOwn_ReConfig

◆ ae2f_ds_Alloc_cOwn_Init()

Initialises the pointer.
Injects the function pointers automatically.

Parameters
ThisAddress to be set.
Do not pass when it is allocated.
impClass Implementations
Returns
ae2f_errGlob_OK
Exceptions

ae2f_ds_Alloc_Err_FPIMPNULL
ae2f_errGlob_PTR_IS_NULL

See also
ae2f_ds_Alloc_cOwn