![]() |
Murl Engine API
Version 2024.1
|
A generic field template class for fixed-size arrays. More...
#include <murl_field.h>
A generic field template class for fixed-size arrays.
DataType | The value's data type of the field. |
Public Types | |
using | ValueType = DataType |
The template parameter value type. | |
using | ConstIterator = const DataType * |
Definition of the const iterator. | |
using | Iterator = DataType * |
Definition of the iterator. | |
Public Member Functions | |
Field () | |
Default constructor. | |
Field (const Field &other) | |
Construct a field from an already existing one, performing a deep copy. More... | |
~Field () | |
Destroy the field and all of its contents. | |
void | operator= (const Field &other) |
Assign the content of another field to this one, performing a deep copy. More... | |
DataType & | Set (SInt32 index, const DataType &item) |
Initialize an item with a given item. More... | |
Bool | Set (SInt32 index, const DataType &item, SInt32 count) |
Initialize a range of items with a given item. More... | |
void | Fill (const DataType &item) |
Fill all items with a given item. More... | |
void | Swap (SInt32 index1, SInt32 index2) |
Swap two field items. More... | |
SInt32 | Find (const DataType &item) const |
Find the first occurrence of a given item in the field. More... | |
SInt32 | Find (const DataType &item, SInt32 firstIndex) const |
Find the first occurrence of a given item in the field. More... | |
SInt32 | FindLast (const DataType &item) const |
Find the last occurrence of a given item in the field. More... | |
SInt32 | FindLast (const DataType &item, SInt32 lastIndex) const |
Find the last occurrence of a given item in the field. More... | |
DataType & | Front () |
Retrieve the first item from the field. More... | |
const DataType & | Front () const |
Retrieve the first item from the field. More... | |
DataType & | Back () |
Retrieve the last item from the field. More... | |
const DataType & | Back () const |
Retrieve the last item from the field. More... | |
DataType & | Bottom () |
Retrieve the first item from the field. More... | |
const DataType & | Bottom () const |
Retrieve the first item from the field. More... | |
DataType & | Top () |
Retrieve the last item from the field. More... | |
const DataType & | Top () const |
Retrieve the last item from the field. More... | |
DataType & | At (SInt32 index) |
Retrieve the item at a given position from the field. More... | |
DataType & | At (SInt32 index, const DataType &item) |
Retrieve the item at a given position from the field. More... | |
SInt32 | GetCount () const |
Get the number of items in the field. More... | |
Bool | IsEqual (const Field &other) const |
Compare the field to another one. More... | |
bool | operator== (const Field &rhs) const |
The "equal to" comparison operator, calls IsEqual(). More... | |
bool | operator!= (const Field &rhs) const |
The "not equal to" comparison operator, calls IsEqual(). More... | |
Bool | IsIndexValid (SInt32 index) const |
Check if a given index is a valid index. More... | |
DataType & | operator[] (SInt32 index) |
Retrieve the item at a given position from the field. More... | |
const DataType & | operator[] (SInt32 index) const |
Retrieve the item at a given position from the field. More... | |
DataType & | Get (SInt32 index) |
Get the item at a given position from the field. More... | |
const DataType & | Get (SInt32 index) const |
Get the item at a given position from the field. More... | |
operator DataType * () | |
Conversion operator to the underlying raw array. More... | |
operator const DataType * () const | |
Conversion operator to the underlying raw array. More... | |
UInt32 | GetByteSize () const |
Get the number of bytes of the underlying raw array. More... | |
ConstIterator | Begin () const |
Get the const iterator to the first item. More... | |
ConstIterator | End () const |
Get the const iterator next to the last item. More... | |
ConstIterator | GetIter (SInt32 index) const |
Get the const iterator of a specified index. More... | |
SInt32 | GetIterIndex (ConstIterator iterator) const |
Get the item index by iterator. More... | |
void | Swap (Field &other) |
Exchange the content of the field with a given second one. More... | |
Iterator | Begin () |
Get the iterator to the first item. More... | |
Iterator | End () |
Get the iterator next to the last item. More... | |
Iterator | GetIter (SInt32 index) |
Get the iterator of a specified index. More... | |
|
inline |
Construct a field from an already existing one, performing a deep copy.
other | The field to copy. |
|
inline |
Assign the content of another field to this one, performing a deep copy.
other | The source field. |
|
inline |
Initialize an item with a given item.
index | The index of the item to set. |
item | The source item to copy. |
|
inline |
Initialize a range of items with a given item.
index | The index of the first item to set. |
item | The source item to copy. |
count | The number of items to set. |
|
inline |
Fill all items with a given item.
item | The source item to copy. |
|
inline |
Swap two field items.
index1 | The index of the first item. |
index2 | The index of the second item. |
|
inline |
Find the first occurrence of a given item in the field.
item | The item to find. |
|
inline |
Find the first occurrence of a given item in the field.
item | The item to find. |
firstIndex | The index where to start searching. |
|
inline |
Find the last occurrence of a given item in the field.
item | The item to find. |
|
inline |
Find the last occurrence of a given item in the field.
item | The item to find. |
lastIndex | The index where to start searching. |
|
inline |
Retrieve the first item from the field.
Synonymous to Bottom().
|
inline |
Retrieve the first item from the field.
Synonymous to Bottom().
|
inline |
|
inline |
Retrieve the last item from the field.
Synonymous to Top().
|
inline |
Retrieve the first item from the field.
|
inline |
Retrieve the first item from the field.
|
inline |
Retrieve the last item from the field.
|
inline |
Retrieve the last item from the field.
|
inline |
Retrieve the item at a given position from the field.
index | The zero-based index of the item to retrieve. |
|
inline |
Retrieve the item at a given position from the field.
index | The zero-based index of the item to retrieve. |
item | The reference item used for initialization. |
|
inline |
Get the number of items in the field.
|
inline |
Compare the field to another one.
other | The field to compare. |
|
inline |
The "equal to" comparison operator, calls IsEqual().
rhs | The right hand side field to compare. |
|
inline |
The "not equal to" comparison operator, calls IsEqual().
rhs | The right hand side field to compare. |
|
inline |
Check if a given index is a valid index.
index | The index to check. |
|
inline |
Retrieve the item at a given position from the field.
index | The zero-based index of the item to retrieve. |
|
inline |
Retrieve the item at a given position from the field.
index | The zero-based index of the item to retrieve. |
|
inline |
Get the item at a given position from the field.
index | The zero-based index of the item to retrieve. |
|
inline |
Get the item at a given position from the field.
index | The zero-based index of the item to retrieve. |
|
inline |
Conversion operator to the underlying raw array.
|
inline |
Conversion operator to the underlying raw array.
|
inline |
Get the number of bytes of the underlying raw array.
|
inline |
Get the const iterator to the first item.
|
inline |
Get the const iterator next to the last item.
|
inline |
Get the const iterator of a specified index.
index | The index for the iterator. |
|
inline |
Get the item index by iterator.
(!) Adding or removing items will invalidate iterators.
iterator | The iterator of the item. |
|
inline |
Exchange the content of the field with a given second one.
other | The second field. |
|
inline |
Get the iterator to the first item.
|
inline |
Get the iterator next to the last item.
|
inline |
Get the iterator of a specified index.
index | The index for the iterator. |