ae2f::Core
Loading...
Searching...
No Matches
Own.hpp
Go to the documentation of this file.
1
5
6namespace ae2f { namespace Ds { namespace Alloc {
7
15 struct xrOwner : public rOwner {
16 public:
31 inline ae2f_errint_t Read(size_t i, void* dest, size_t destlen) const noexcept {
32 return ae2f_ds_Alloc_cOwn_Read(this, i, dest, destlen);
33 }
34
50 inline ae2f_errint_t Write(size_t i, const void* src, size_t srclen) noexcept {
51 return ae2f_ds_Alloc_cOwn_Write(this, i, src, srclen);
52 }
53
67 inline ae2f_errint_t Length(size_t* lenbuff, size_t* elsizebuff) const noexcept {
68 return ae2f_ds_Alloc_cOwn_getSize(this, lenbuff, elsizebuff);
69 }
70
86 inline ae2f_errint_t Resize(size_t bytecount) noexcept {
87 return ae2f_ds_Alloc_cOwn_ReSize(this, bytecount);
88 }
89
102 inline ae2f_errint_t ReConfig(size_t elcount, size_t elsize) {
103 return ae2f_ds_Alloc_cOwn_ReConfig(this, elcount, elsize);
104 }
105
117 inline ~xrOwner() noexcept {
119 }
120
136 inline ae2f_errint_t Copy(const rRefer& src) noexcept {
137 return ae2f_ds_Alloc_cOwn_Cpy(this, &src);
138 }
139
155 inline ae2f_errint_t Copy(const rRefer&& src) noexcept {
156 return ae2f_ds_Alloc_cOwn_Cpy(this, &src);
157 }
158
172 inline xrOwner(
173 ae2f_errint_t* perr,
174 const ae2f_ds_vAlloc* imp
175 ) noexcept : rOwner() {
176 perr = perr ? perr : &ae2f_errGlob_LastErr;
177 *perr |= ae2f_ds_Alloc_cOwn_Init(this, imp);
178 }
179 };
180
190 template<const ae2f_ds_vAlloc* __imp>
191 struct iOwner : public xrOwner, public vfDef<__imp> {
206 inline iOwner(
207 ae2f_errint_t* perr = 0
208 ) noexcept : xrOwner(perr, __imp) {}
209 };
210}}}
#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
#define ae2f_ds_Alloc_cOwn_Cpy(This, Source)
Allocates the memory. Copies the data from [Source] to [This].
Definition Own.h:114
#define ae2f_ds_Alloc_cOwn_Read
Gets data from a class.
Definition Own.h:150
#define ae2f_ds_Alloc_cOwn_Write
Sets data to a class.
Definition Own.h:167
#define ae2f_ds_Alloc_cOwn_getSize
Gets the length, and element size of the class.
Definition Own.h:134
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.
#define ae2f_ds_Alloc_cOwn_ReSize(This, bytecount)
Resizes the memory of [This] as bytes count. Additional memories(newly allocated) must be initiated ...
Definition Own.h:208
#define ae2f_ds_Alloc_cOwn_Del(This)
Frees the memory of [This].
Definition Own.h:177
ae2f_extern ae2f_errint_t ae2f_errGlob_LastErr
Definition errGlob.h:52
uint8_t ae2f_errint_t
Informs that this number represents the error.
Definition errGlob.h:10
ae2f_ds_Alloc_cOwn rOwner
Definition Defs.hpp:27
ae2f_ds_Alloc_cRef rRefer
Definition Defs.hpp:19
Definition Alloc.hpp:6
Definition Own.hpp:191
iOwner(ae2f_errint_t *perr=0) noexcept
Initialises the pointer. Injects the function pointers automatically.
Definition Own.hpp:206
Definition Alloc.hpp:13
Definition Own.hpp:15
ae2f_errint_t Length(size_t *lenbuff, size_t *elsizebuff) const noexcept
Gets the length, and element size of the class.
Definition Own.hpp:67
xrOwner(ae2f_errint_t *perr, const ae2f_ds_vAlloc *imp) noexcept
Initialises the pointer. Injects the function pointers automatically.
Definition Own.hpp:172
ae2f_errint_t Copy(const rRefer &src) noexcept
Allocates the memory. Copies the data from [src] to a class.
Definition Own.hpp:136
ae2f_errint_t Write(size_t i, const void *src, size_t srclen) noexcept
Sets data to a class.
Definition Own.hpp:50
ae2f_errint_t Read(size_t i, void *dest, size_t destlen) const noexcept
Gets data from a class.
Definition Own.hpp:31
ae2f_errint_t Copy(const rRefer &&src) noexcept
Allocates the memory. Copies the data from [src] to a class.
Definition Own.hpp:155
ae2f_errint_t ReConfig(size_t elcount, size_t elsize)
Resizes the memory of [This]. Additional memories(newly allocated) must be initiated as 0.
Definition Own.hpp:102
ae2f_errint_t Resize(size_t bytecount) noexcept
Resizes the memory of [This] as bytes count. Additional memories(newly allocated) must be initiated ...
Definition Own.hpp:86
~xrOwner() noexcept
Frees the memory of class. Error code will be stored in ae2f_errGlob_LastErr.
Definition Own.hpp:117
Structure for virtual function pointer.
Definition Alloc.h:20