Definition at line 199 of file xsens_list.h.
#include <xSens_MT3/xsens_list.h>
Public Types | |
typedef int32_t(* | cmpFunc) (const uint32_t &, const uint32_t &) |
A comparison function type, should return -1, 0 or 1 for <, == and > More... | |
typedef int32_t(__cdecl * | InequalityFunction) (const uint32_t &, const uint32_t &) |
Type for an equality compare function, should return true when NOT equal. More... | |
Public Member Functions | |
IntList () | |
Standard constructor, creates an empty list with some room for items. More... | |
IntList (const uint32_t size) | |
Construct a list with a capacity of at least the given size. More... | |
IntList (const IntList &src) | |
Construct a list as a direct copy of another list. More... | |
IntList (const uint32_t size, uint32_t *src) | |
Construct a list as a reference to a raw list. More... | |
bool | operator== (const IntList &lst) |
void | addValue (int32_t value) |
int32_t | deserialize (const char *str) |
int32_t | readFromString (const char *str) |
int32_t | serialize (char *buffer) const |
void | setIncremental (const uint32_t start, const uint32_t end, const int32_t step) |
int32_t | writeToString (char *buffer) const |
int32_t | writeToStringHex (char *buffer) const |
void | deleteAndClear (void) |
Calls delete for all items in the list and then clears the list. More... | |
void | freeAndClear (void) |
Calls free for all items in the list and then clears the list. More... | |
void | clear (void) |
Clears the list without explicitly deleting anything. More... | |
void | resize (uint32_t newSize) |
Resizes the list to at least the given size. More... | |
void | append (const uint32_t &item) |
Adds an item to the end of the list. More... | |
void | appendList (uint32_t count, const uint32_t *lst) |
Adds a number of items to the end of the list. More... | |
void | appendDeepCopy (const List< uint32_t > &source) |
Adds the contents of the source list to the end of the list. More... | |
void | appendShallowCopy (const List< uint32_t > &source) |
Adds the contents of the source list to the end of the list. More... | |
void | appendCopy (const TB &item) |
Adds a copy of a referenced item to the end of the list. More... | |
void | appendRelated (const TR &item) |
Adds a related item to the end of the list, using the T = TR operator. More... | |
void | remove (const uint32_t index) XSENS_LIST_THROW |
Removes an item at the given index in the list. More... | |
void | swap (const uint32_t i, const uint32_t j) XSENS_LIST_THROW |
Swaps two items in the list. More... | |
void | deleteAndRemove (const uint32_t index) XSENS_LIST_THROW |
Removes an item at the given index in the list. More... | |
void | freeAndRemove (const uint32_t index) XSENS_LIST_THROW |
Removes an item at the given index in the list. More... | |
uint32_t & | last (void) const XSENS_LIST_THROW |
Retrieves the last item. More... | |
uint32_t & | get (const uint32_t index) const XSENS_LIST_THROW |
Retrieves the item at the given index. An index beyond the end returns the first item. More... | |
uint32_t & | operator[] (const uint32_t index) const XSENS_LIST_THROW |
Retrieves the item at the given index. An index beyond the end probably causes an exception. More... | |
void | insert (const uint32_t &item, const uint32_t index) |
Inserts an item at the given index, shifting any items below it down one spot. More... | |
void | insertCopy (const TB &item, const uint32_t index) |
Inserts a copy of the referenced item at the given index, shifting any items below it down one spot. More... | |
uint32_t | insertSorted (const uint32_t &item) |
Assumes the list is sorted and inserts the item at the appropriate spot. More... | |
uint32_t | insertSortedDeref (const uint32_t &item) |
Assumes the list is sorted by dereferenced values and inserts the item at the appropriate spot. More... | |
uint32_t | insertSortedCopy (const TB &item) |
Assumes the list is sorted and inserts a copy of the referenced item at the appropriate spot. More... | |
uint32_t | length (void) const |
Returns the number of items currently in the list. More... | |
void | sortAscending (void) |
Sorts the list in an ascending order, using the T::< operator. More... | |
void | sortAscendingDeref (void) |
Sorts the list in an ascending order, using the T::< operator on dereferenced list items. More... | |
void | twinSortAscending (List< T2 > &twin) |
Sorts the first list in an ascending order, using the T::< operator, the second list will be updated the same way. More... | |
uint32_t | find (const TB &item) const |
Finds an item in an unsorted list (walk over all items) using the T::== operator. More... | |
uint32_t | find (const uint32_t item, InequalityFunction fnc) const |
Finds an item in an unsorted list (walk over all items) using the given inequality function. More... | |
uint32_t | findDeref (const TB &item) const |
Finds an item in an unsorted list (walk over all items) using the T::== operator on dereferenced list items. More... | |
uint32_t | findSorted (const TB &item) const |
Finds an item in a sorted list (binary search) using the T::== and T::< operators. More... | |
uint32_t | findSortedDeref (const TB &item) const |
Finds an item in a sorted list (binary search) using the T::== and T::< operators on dereferenced list items. More... | |
void | reverse (void) |
Reverse the order of the list, useful for sorted lists that are read/created in the reverse order. More... | |
void | removeTail (const uint32_t count) XSENS_LIST_THROW |
Removes items from the end of the list. More... | |
void | deleteAndRemoveTail (const uint32_t count) XSENS_LIST_THROW |
void | freeAndRemoveTail (const uint32_t count) XSENS_LIST_THROW |
void | deleteItemsOnDestroy (void) |
void | freeItemsOnDestroy (void) |
uint32_t | removeDuplicateEntries (void) |
Removes any duplicate entries and returns the number of items removed. Items are compared directly. More... | |
uint32_t | removeDuplicateEntriesDeref (void) |
Removes any duplicate entries and returns the number of items removed. Items are compared after dereferencing. More... | |
void | isDeepCopyOf (const List< uint32_t > &source) |
Make a copy of the list, duplicating list items i with: copy[i] = new TB(*source[i]) More... | |
void | isShallowCopyOf (const List< uint32_t > &source) |
Overwrites the current list with a shallow (memcopy) copy of another list. More... | |
const uint32_t * | getBuffer (void) const |
Returns the start of the linear data buffer. More... | |
Protected Attributes | |
uint32_t * | m_data |
The array containing the items. More... | |
uint32_t | m_max |
The current size of the data array. More... | |
uint32_t | m_count |
The number of items currently in the list. More... | |
JanitorClassFunc< List< uint32_t > > * | m_jcf |
Used to clean up the list on exit. More... | |
bool | m_manage |
Private Member Functions | |
void | operator= (const IntList &list) |
intentionally NOT implemented due to ambiguous nature More... | |
|
inherited |
A comparison function type, should return -1, 0 or 1 for <, == and >
Definition at line 81 of file xsens_list.h.
|
inherited |
Type for an equality compare function, should return true when NOT equal.
Definition at line 171 of file xsens_list.h.
|
inline |
Standard constructor, creates an empty list with some room for items.
Definition at line 205 of file xsens_list.h.
|
inline |
Construct a list with a capacity of at least the given size.
Definition at line 207 of file xsens_list.h.
|
inline |
Construct a list as a direct copy of another list.
Definition at line 209 of file xsens_list.h.
Construct a list as a reference to a raw list.
Definition at line 211 of file xsens_list.h.
Definition at line 157 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, and xsens::List< uint32_t >::m_data.
|
inherited |
Adds an item to the end of the list.
Definition at line 150 of file xsens_list.hpp.
|
inherited |
Adds a copy of a referenced item to the end of the list.
Definition at line 188 of file xsens_list.hpp.
|
inherited |
Adds the contents of the source list to the end of the list.
Definition at line 167 of file xsens_list.hpp.
|
inherited |
Adds a number of items to the end of the list.
Definition at line 158 of file xsens_list.hpp.
|
inherited |
Adds a related item to the end of the list, using the T = TR operator.
Definition at line 197 of file xsens_list.hpp.
|
inherited |
Adds the contents of the source list to the end of the list.
Definition at line 177 of file xsens_list.hpp.
|
inherited |
Clears the list without explicitly deleting anything.
Definition at line 126 of file xsens_list.hpp.
|
inherited |
Calls delete for all items in the list and then clears the list.
Definition at line 110 of file xsens_list.hpp.
|
inherited |
Removes an item at the given index in the list.
Definition at line 877 of file xsens_list.hpp.
|
inherited |
Definition at line 807 of file xsens_list.hpp.
|
inherited |
Definition at line 1110 of file xsens_list.hpp.
int32_t xsens::IntList::deserialize | ( | const char * | str | ) |
Definition at line 56 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< uint32_t >::m_data, mrpt::system::os::memcpy(), and xsens::List< uint32_t >::resize().
|
inherited |
Finds an item in an unsorted list (walk over all items) using the T::== operator.
Definition at line 914 of file xsens_list.hpp.
References XSENS_LIST_NOTFOUND.
|
inherited |
Finds an item in an unsorted list (walk over all items) using the given inequality function.
Definition at line 923 of file xsens_list.hpp.
References XSENS_LIST_NOTFOUND.
|
inherited |
Finds an item in an unsorted list (walk over all items) using the T::== operator on dereferenced list items.
Definition at line 933 of file xsens_list.hpp.
References XSENS_LIST_NOTFOUND.
|
inherited |
Finds an item in a sorted list (binary search) using the T::== and T::< operators.
Definition at line 943 of file xsens_list.hpp.
References CMT_LIST_LINEAR_SEARCH_TRESHOLD, mrpt::utils::find(), and XSENS_LIST_NOTFOUND.
|
inherited |
Finds an item in a sorted list (binary search) using the T::== and T::< operators on dereferenced list items.
Definition at line 968 of file xsens_list.hpp.
References CMT_LIST_LINEAR_SEARCH_TRESHOLD, and XSENS_LIST_NOTFOUND.
|
inherited |
Calls free for all items in the list and then clears the list.
Definition at line 118 of file xsens_list.hpp.
|
inherited |
Removes an item at the given index in the list.
Definition at line 895 of file xsens_list.hpp.
|
inherited |
Definition at line 823 of file xsens_list.hpp.
|
inherited |
Definition at line 1121 of file xsens_list.hpp.
|
inherited |
Retrieves the item at the given index. An index beyond the end returns the first item.
Definition at line 215 of file xsens_list.hpp.
|
inlineinherited |
Returns the start of the linear data buffer.
Definition at line 190 of file xsens_list.h.
References xsens::List< T >::m_data.
|
inherited |
Inserts an item at the given index, shifting any items below it down one spot.
Definition at line 227 of file xsens_list.hpp.
|
inherited |
Inserts a copy of the referenced item at the given index, shifting any items below it down one spot.
Definition at line 242 of file xsens_list.hpp.
|
inherited |
Assumes the list is sorted and inserts the item at the appropriate spot.
Definition at line 992 of file xsens_list.hpp.
References CMT_LIST_LINEAR_SEARCH_TRESHOLD.
|
inherited |
Assumes the list is sorted and inserts a copy of the referenced item at the appropriate spot.
Definition at line 1071 of file xsens_list.hpp.
References CMT_LIST_LINEAR_SEARCH_TRESHOLD.
|
inherited |
Assumes the list is sorted by dereferenced values and inserts the item at the appropriate spot.
Definition at line 1031 of file xsens_list.hpp.
References CMT_LIST_LINEAR_SEARCH_TRESHOLD.
|
inherited |
Make a copy of the list, duplicating list items i with: copy[i] = new TB(*source[i])
Definition at line 1133 of file xsens_list.hpp.
|
inherited |
Overwrites the current list with a shallow (memcopy) copy of another list.
Definition at line 1144 of file xsens_list.hpp.
|
inherited |
Retrieves the last item.
Definition at line 205 of file xsens_list.hpp.
|
inlineinherited |
Returns the number of items currently in the list.
Definition at line 143 of file xsens_list.h.
References xsens::List< T >::m_count.
intentionally NOT implemented due to ambiguous nature
bool xsens::IntList::operator== | ( | const IntList & | lst | ) |
Definition at line 164 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< T >::m_count, xsens::List< uint32_t >::m_data, and xsens::List< T >::m_data.
|
inherited |
Retrieves the item at the given index. An index beyond the end probably causes an exception.
Definition at line 256 of file xsens_list.hpp.
int32_t xsens::IntList::readFromString | ( | const char * | str | ) |
Definition at line 96 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< uint32_t >::m_data, and xsens::List< uint32_t >::resize().
|
inherited |
Removes an item at the given index in the list.
Definition at line 775 of file xsens_list.hpp.
|
inherited |
Removes any duplicate entries and returns the number of items removed. Items are compared directly.
Definition at line 839 of file xsens_list.hpp.
|
inherited |
Removes any duplicate entries and returns the number of items removed. Items are compared after dereferencing.
Definition at line 858 of file xsens_list.hpp.
|
inherited |
Removes items from the end of the list.
Definition at line 792 of file xsens_list.hpp.
|
inherited |
Resizes the list to at least the given size.
Definition at line 132 of file xsens_list.hpp.
Referenced by deserialize(), readFromString(), and setIncremental().
|
inherited |
Reverse the order of the list, useful for sorted lists that are read/created in the reverse order.
Definition at line 1167 of file xsens_list.hpp.
int32_t xsens::IntList::serialize | ( | char * | buffer | ) | const |
Definition at line 66 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< uint32_t >::m_data, and mrpt::system::os::memcpy().
void xsens::IntList::setIncremental | ( | const uint32_t | start, |
const uint32_t | end, | ||
const int32_t | step | ||
) |
Definition at line 76 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< uint32_t >::m_data, xsens::List< uint32_t >::m_max, and xsens::List< uint32_t >::resize().
|
inherited |
Sorts the list in an ascending order, using the T::< operator.
Definition at line 453 of file xsens_list.hpp.
|
inherited |
Sorts the list in an ascending order, using the T::< operator on dereferenced list items.
Definition at line 595 of file xsens_list.hpp.
|
inherited |
Swaps two items in the list.
Definition at line 1155 of file xsens_list.hpp.
|
inherited |
Sorts the first list in an ascending order, using the T::< operator, the second list will be updated the same way.
Definition at line 738 of file xsens_list.hpp.
References xsens::List< T >::m_count, and xsens::List< T >::m_data.
int32_t xsens::IntList::writeToString | ( | char * | buffer | ) | const |
Definition at line 119 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< uint32_t >::m_data, and mrpt::system::os::sprintf().
int32_t xsens::IntList::writeToStringHex | ( | char * | buffer | ) | const |
Definition at line 138 of file xsens_list.cpp.
References xsens::List< uint32_t >::m_count, xsens::List< uint32_t >::m_data, and mrpt::system::os::sprintf().
|
protectedinherited |
The number of items currently in the list.
Definition at line 72 of file xsens_list.h.
Referenced by addValue(), deserialize(), operator==(), readFromString(), serialize(), setIncremental(), writeToString(), and writeToStringHex().
|
protectedinherited |
The array containing the items.
Definition at line 70 of file xsens_list.h.
Referenced by addValue(), deserialize(), operator==(), readFromString(), serialize(), setIncremental(), writeToString(), and writeToStringHex().
|
protectedinherited |
Used to clean up the list on exit.
Definition at line 73 of file xsens_list.h.
|
protectedinherited |
Definition at line 74 of file xsens_list.h.
|
protectedinherited |
The current size of the data array.
Definition at line 71 of file xsens_list.h.
Referenced by setIncremental().
Page generated by Doxygen 1.8.14 for MRPT 1.5.7 Git: 5902e14cc Wed Apr 24 15:04:01 2019 +0200 at lun oct 28 01:39:17 CET 2019 |