This object describes how to treat the data in an array.
More...
#include <xsarray.h>
|
int(* | itemCompare )(void const *a, void const *b) |
| The function to use for comparing two items. More...
|
|
void(* | itemConstruct )(void *e) |
| The function to use for constructing a new array item. May be 0 for simple types. More...
|
|
void(* | itemCopy )(void *to, void const *from) |
| The function to use for copying the data of from to to. More...
|
|
void(* | itemCopyConstruct )(void *e, void const *s) |
| The function to use for constructing a new array item with a source initializer. This may not be 0. More...
|
|
void(* | itemDestruct )(void *e) |
| The function to use for destructing a array item. May be 0 for simple types. More...
|
|
const XsSize | itemSize |
| The size of an array item in bytes. More...
|
|
void(* | itemSwap )(void *a, void *b) |
| The function to use for swapping the data of two array items. More...
|
|
void(* | rawCopy )(void *to, void const *from, XsSize count, XsSize iSize) |
| The function to use for copying the data of an array of from to to. More...
|
|
This object describes how to treat the data in an array.
Ususally there is one static instance per type of array that will be used by all XsArrays of that type.
Definition at line 103 of file xsarray.h.
◆ itemCompare
int(* XsArrayDescriptor::itemCompare) (void const *a, void const *b) |
The function to use for comparing two items.
- Parameters
-
a | Left hand side of comparison. |
b | Right hand side of comparison. |
- Returns
- The function will return 0 when the items are equal. When greater/less comparison is possible, the function should return < 0 if a < b and > 0 if a > b.
Definition at line 117 of file xsarray.h.
◆ itemConstruct
void(* XsArrayDescriptor::itemConstruct) (void *e) |
The function to use for constructing a new array item. May be 0 for simple types.
- Parameters
-
e | Pointer to item to construct. |
Definition at line 113 of file xsarray.h.
◆ itemCopy
void(* XsArrayDescriptor::itemCopy) (void *to, void const *from) |
The function to use for copying the data of from to to.
- Parameters
-
to | Pointer to item to copy to. |
from | Pointer to item to copy from. |
Definition at line 116 of file xsarray.h.
◆ itemCopyConstruct
void(* XsArrayDescriptor::itemCopyConstruct) (void *e, void const *s) |
The function to use for constructing a new array item with a source initializer. This may not be 0.
- Parameters
-
e | Pointer to item to construct. |
s | Pointer to source item to copy from. |
Definition at line 114 of file xsarray.h.
◆ itemDestruct
void(* XsArrayDescriptor::itemDestruct) (void *e) |
The function to use for destructing a array item. May be 0 for simple types.
- Parameters
-
e | Pointer to item to destruct. |
Definition at line 115 of file xsarray.h.
◆ itemSize
const XsSize XsArrayDescriptor::itemSize |
The size of an array item in bytes.
Definition at line 111 of file xsarray.h.
◆ itemSwap
void(* XsArrayDescriptor::itemSwap) (void *a, void *b) |
The function to use for swapping the data of two array items.
- Parameters
-
a | Pointer to first item to swap. |
b | Pointer to second item to swap. |
Definition at line 112 of file xsarray.h.
◆ rawCopy
void(* XsArrayDescriptor::rawCopy) (void *to, void const *from, XsSize count, XsSize iSize) |
The function to use for copying the data of an array of from to to.
- Parameters
-
to | Pointer to array to copy to. |
from | Pointer to array to copy from. |
count | The number of items to copy. |
iSize | The size of an individual item, should match the itemSize descriptor field. |
- Note
- If this function pointer is 0, itemCopy will be used instead.
-
XsArray_rawCopy can be used here for all types that can be safely memcpy'd. This typically means all means non-pointer types and structures containing only types matching these criteria.
Definition at line 118 of file xsarray.h.
The documentation for this struct was generated from the following file: