33#include <NDEVR/BaseValues.h>
34#include <NDEVR/LibAssert.h>
35#include <NDEVR/ObjectAllocator.h>
36#include <NDEVR/BufferAllocator.h>
37#include <NDEVR/ObjectInfo.h>
38#include <initializer_list>
54 template<class t_type, class t_index_type = uint04, class t_memory_allocator = ObjectAllocator<ObjectInfo<t_type>::Primitive, t_index_type>,
class t_memory_manager = BufferAllocator<t_type, t_index_type, false>>
62 : m_memory_interface()
69 : m_memory_interface()
78 : m_memory_interface(std::move(buffer.m_memory_interface))
86 : m_memory_interface()
88 m_memory_interface.resizeSpace(
size);
95 : m_memory_interface()
105 : m_memory_interface()
107 m_memory_interface.template createSpace<false>(
size);
108 t_memory_allocator::template AllocateElement<t_type>(m_memory_interface, 0,
size, fill_object);
115 : m_memory_interface()
123 template<
class t_iterator>
125 : m_memory_interface()
129 for (
auto iter =
begin; iter !=
end; iter++)
131 get(index++) = *iter;
145 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, 0,
size());
152 operator const t_type* ()
const
175 for (t_index_type i = 0; i <
size(); i++)
177 other.
add(t_other_type(
get(i)));
188 m_memory_interface.addIndex();
189 t_memory_allocator::template AllocateElement(m_memory_interface,
size() - 1, std::move(
object));
195 void add(
const t_type&
object)
197 m_memory_interface.addIndex();
198 t_memory_allocator::template AllocateElement(m_memory_interface,
size() - 1,
object);
206 void add(t_index_type location,
const t_type&
object)
208 m_memory_interface.addIndex(location);
209 t_memory_allocator::template AllocateElement(m_memory_interface, location,
object);
216 void add(t_index_type location, t_type&&
object)
218 m_memory_interface.addIndex(location);
219 t_memory_allocator::template AllocateElement(m_memory_interface, location, std::move(
object));
227 void insert(t_index_type location,
const t_type&
object)
229 m_memory_interface.addIndex(location);
230 t_memory_allocator::template AllocateElement(m_memory_interface, location,
object);
237 void insert(t_index_type location, t_type&&
object)
239 m_memory_interface.addIndex(location);
240 t_memory_allocator::template AllocateElement(m_memory_interface, location, std::move(
object));
242 template<
class t_other_memory_allocator,
class t_other_index_type,
class t_other_memory_manager>
245 t_index_type offset =
size();
246 m_memory_interface.template createSpace<false>(buffer.
size());
247 if constexpr (t_memory_allocator::isPrimitive())
253 for (t_index_type i = 0; i < buffer.
size(); i++)
254 t_memory_allocator::template AllocateElement(m_memory_interface, i + offset, buffer[i]);
257 void addAll(
const t_type* buffer, t_index_type buffer_size)
259 t_index_type offset =
size();
260 m_memory_interface.template createSpace<false>(buffer_size);
261 if constexpr (t_memory_allocator::isPrimitive())
263 m_memory_interface.template
setAll<true>(buffer, offset, buffer_size);
267 for (t_index_type i = 0; i < buffer_size; i++)
268 t_memory_allocator::AllocateElement(m_memory_interface, i + offset, buffer[i]);
273 t_index_type
size = 0;
277 if (memcmp(&buffer[
size], &loc,
sizeof(t_type)) == 0)
285 m_memory_interface.template createSpace<false>(offset, buffer.
size());
286 if constexpr (t_memory_allocator::isPrimitive())
288 m_memory_interface.template
setAll<true>(buffer.m_memory_interface, offset, 0, buffer.
size());
292 for (t_index_type i = 0; i < buffer.
size(); i++)
293 t_memory_allocator::AllocateElement(m_memory_interface, i + offset, buffer[i]);
298 lib_assert(offset + replace_size <=
size(),
"end > size in buffer replace");
299 if (replace_size < buffer.
size())
301 t_index_type size_dff = buffer.
size() - replace_size;
302 m_memory_interface.template createSpace<false>(offset, size_dff);
303 if constexpr (!t_memory_allocator::isPrimitive())
305 for (t_index_type i = 0; i < size_dff; i++)
306 t_memory_allocator::AllocateElement(m_memory_interface, i + offset, buffer[i]);
309 else if (replace_size > buffer.
size())
318 #pragma clang diagnostic push
319 #pragma clang diagnostic ignored "-Wunused-value"
327 void insert(t_index_type offset,
const t_type*
const buffer, t_index_type buffer_size)
329 m_memory_interface.template createSpace<false>(offset, buffer_size);
330 if constexpr (t_memory_allocator::isPrimitive())
332 m_memory_interface.template
setAll<true>(buffer, offset, buffer_size);
336 for (t_index_type i = 0; i < buffer_size; i++)
337 t_memory_allocator::AllocateElement(m_memory_interface, i + offset, buffer[i]);
341 #pragma clang diagnostic pop
348 void insert(
const t_index_type location,
const t_type* buffer)
350 t_index_type
size = 0;
354 if (memcmp(&buffer[
size], &loc,
sizeof(t_type)) == 0)
365 template<
bool t_managed>
368 const t_index_type offset =
size();
369 m_memory_interface.template createSpace<t_managed>(space_to_add);
370 t_memory_allocator::template Allocate<t_type>(m_memory_interface, offset,
size() - offset);
372 template<
bool t_managed = false>
375 const t_index_type offset =
size();
376 m_memory_interface.template createSpace<t_managed>(space_to_add);
377 t_memory_allocator::template AllocateElement<t_type>(m_memory_interface, offset,
size() - offset, fill_object);
379 template<
bool t_managed>
382 lib_assert(location <= this->
size(),
"Tried to insert into a bad location");
383 m_memory_interface.template createSpace<t_managed>(location,
size);
385 t_memory_allocator::template Allocate<t_type>(m_memory_interface, location,
size);
387 [[nodiscard]]
decltype(
auto)
ptr()
389 return m_memory_interface.ptr();
392 [[nodiscard]]
decltype(
auto)
ptr()
const
394 return m_memory_interface.ptr();
399 return m_memory_interface.memSize();
402 [[nodiscard]]
decltype(
auto)
begin()
404 return m_memory_interface.begin();
407 [[nodiscard]]
decltype(
auto)
begin()
const
409 return m_memory_interface.begin();
412 [[nodiscard]]
decltype(
auto)
begin(t_index_type index)
const
414 return m_memory_interface.begin(index);
419 return m_memory_interface.capacity();
424 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, 0U,
size());
425 m_memory_interface.clear();
427 void clear(t_index_type new_capacity)
429 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, 0,
size());
430 m_memory_interface.clear();
441 sint04 cmp_value = m_memory_interface.compare(value.m_memory_interface);
453 sint04 cmp_value = m_memory_interface.compare(value.m_memory_interface, start,
end);
465 [[nodiscard]]
bool contains(
const t_type& element)
const
467 for (t_index_type i = 0; i <
size(); ++i)
469 if (
get(i) == element)
474 [[nodiscard]]
bool contains(
const t_type& element,
const std::function<
bool(
const t_type&,
const t_type&)>& equal_function)
const
478 if (equal_function(
get(i), element))
483 [[nodiscard]]
bool contains(
const t_type& element, t_index_type start)
const
485 lib_assert(start <
size(),
"buffer contains using bad start value");
486 for (t_index_type i = start; i <
size(); ++i)
488 if (
get(i) == element)
493 [[nodiscard]]
bool contains(
const t_type& element, t_index_type start, t_index_type search_size)
const
495 lib_assert(search_size + start <=
size(),
"buffer contains using bad start value");
496 for (t_index_type i = start; i < start + search_size; ++i)
498 if (
get(i) == element)
503 [[nodiscard]] t_index_type
count(
const t_type& element)
const
505 return m_memory_interface.count(element);
509 return m_memory_interface.end();
511 [[nodiscard]]
decltype(
auto)
end()
const
513 return m_memory_interface.end();
515 decltype(
auto)
end(t_index_type index)
517 return m_memory_interface.end(index);
519 void ensureCapacity(t_index_type new_capacity,
bool ensure_not_greater =
false,
bool ensure_not_less =
true)
526 m_memory_interface.resizeSpace(new_capacity);
528 else if (ensure_not_greater)
530 lib_assert(new_capacity >=
size(),
"Array can't have capacity less than size");
531 m_memory_interface.resizeSpace(new_capacity);
537 return _equals<t_memory_allocator::isPrimitive()>(buffer);
541 [[nodiscard]]
decltype(
auto)
get(t_index_type index)
544 return m_memory_interface.get(index);
546 [[nodiscard]]
decltype(
auto)
get(t_index_type index)
const
549 return m_memory_interface.get(index);
559 [[nodiscard]] t_index_type
indexOf(
const t_type& element)
const
561 for (t_index_type i = 0; i <
size(); ++i)
563 if (
get(i) == element)
return i;
567 [[nodiscard]] t_index_type
indexOf(
const t_type& element, t_index_type start_pos)
const
569 for (t_index_type i = start_pos; i <
size(); ++i)
571 if (
get(i) == element)
return i;
575 [[nodiscard]] t_index_type
indexOf(
const t_type& element, t_index_type start_pos, t_index_type search_size)
const
577 lib_assert(search_size + start_pos <=
size(),
"bad index of in equation");
578 for (t_index_type i = start_pos; i < start_pos + search_size; ++i)
580 if (
get(i) == element)
return i;
588 [[nodiscard]]
decltype(
auto)
last()
593 [[nodiscard]]
decltype(
auto)
last()
const
598 [[nodiscard]] t_index_type
lastIndexOf(
const t_type& element)
const
600 for (t_index_type i =
size() - 1; i <
size(); --i)
602 if (
get(i) == element)
return i;
609 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, location, 1);
610 m_memory_interface.removeIndex(location);
621 if (
get(i) == element)
632 t_memory_allocator::template Deallocate<t_type>(m_memory_interface,
size() - 1, 1);
633 m_memory_interface.removeLast();
644 for (t_index_type i = 0; i <
end; i++)
646 if (
get(i) ==
object)
663 template<
class t_functor>
667 for (t_index_type i = 0; i <
end; i++)
685 t_index_type start = 0;
687 for (t_index_type i = 0; i <
end; i++)
690 if (
get(i) !=
object)
694 m_memory_interface.removeAllIndex(start,
end);
702 template<
class t_functor>
705 t_index_type start = 0;
707 for (t_index_type i = 0; i <
end; i++)
710 if (!functor(
get(i)))
714 m_memory_interface.removeAllIndex(start,
size());
721 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, start, end - start);
722 m_memory_interface.removeAllIndex(start, end);
724 template<class t_range_buffer>
725 void removeAllIndices(const t_range_buffer& ranges)
728 uint04 last_delete_index = 0;
730 for (const auto& range : ranges)
732 t_index_type start = range.first;
733 t_index_type end = range.second;
735 lib_assert(last_delete_index <= start, "ranges must be ordered
");
736 lib_assert(start <= end, "remove all start >
end");
737 last_delete_index = end;
739 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, start, end - start);
741 m_memory_interface.removeAllIndices(ranges);
743 void replaceAll(const t_type& var, const t_type& replacement)
745 for (t_index_type i = 0; i < size(); i++)
748 get(i) = replacement;
753 for (t_index_type i = 0; i < size() / 2; i++)
755 m_memory_interface.swap(i, size() - i - 1);
758 void reverse(const t_index_type start, const t_index_type end)
760 const t_index_type size = end - start;
761 for (t_index_type i = 0; i < size / 2; i++)
763 m_memory_interface.swap(start + i, (start + size) - i - 1);
766 template<class t_o_type>
767 void setAll(const t_o_type* src, t_index_type offset, t_index_type size)
769 m_memory_interface.template setAll<t_memory_allocator::isPrimitive()>(src, offset, size);
771 void setAll(const Buffer& buffer, t_index_type offset, t_index_type size)
773 lib_assert(buffer.size() >= size, "too small of buffer being used in set all
");
774 m_memory_interface.template setAll<t_memory_allocator::isPrimitive()>(buffer.m_memory_interface, offset, 0, size);
776 void setAll(const Buffer& buffer, t_index_type offset, t_index_type other_offset, t_index_type size)
778 lib_assert(buffer.size() >= size, "too small of buffer being used in set all
");
779 m_memory_interface.template setAll<t_memory_allocator::isPrimitive()>(buffer.m_memory_interface, offset, other_offset, size);
781 template<class t_o_type>
782 void setAllToValue(const t_o_type& fill_element, const t_index_type offset = 0, t_index_type fill_size = Constant<t_index_type>::Invalid)
784 const t_index_type old_size = size();
785 if (IsInvalid(fill_size))
786 fill_size = old_size - offset;
787 else if(offset + fill_size > old_size)
789 m_memory_interface.setSize(offset + fill_size);
791 const t_type value(fill_element);
792 if (t_memory_allocator::isPrimitive() || size() == old_size)
794 m_memory_interface.setAll(value, offset, fill_size);
798 t_index_type size_a = old_size - offset;
799 m_memory_interface.setAll(value, offset, size_a);
800 t_memory_allocator::AllocateElement(m_memory_interface, offset + size_a, fill_size - size_a, value);
803 void setSize(t_index_type new_size)
805 if(new_size < size())
806 t_memory_allocator::template Deallocate<t_type>(m_memory_interface, new_size, size() - new_size);
807 const t_index_type old_size = size();
808 m_memory_interface.setSize(new_size);
809 if (old_size < size())
810 t_memory_allocator::template Allocate<t_type>(m_memory_interface, old_size, size() - old_size);
812 void resize(t_index_type new_size)
816 void setSize(const t_index_type new_size, const t_type& fill_element)
818 const t_index_type old_size = size();
820 if(old_size < new_size)
821 setAllToValue(fill_element, old_size);
823 [[nodiscard]] constexpr t_index_type size() const
825 return m_memory_interface.filledSize();
827 void swapElements(const t_type& element1, const t_type& element2)
829 if (element1 == element2)
831 t_index_type index_1 = Constant<t_index_type>::Invalid;
832 t_index_type index_2 = Constant<t_index_type>::Invalid;
833 for (t_index_type i = 0; i < size(); i++)
835 if (get(i) == element1)
838 if (!IsInvalid(index_2))
840 swapIndices(index_1, index_2);
844 else if (get(i) == element2)
847 if (!IsInvalid(index_1))
849 swapIndices(index_1, index_2);
855 void swapAllElements(const t_type& element1, const t_type& element2)
857 if (element1 == element2)
859 for (t_index_type ii = 0; ii < size(); ++ii)
861 if (get(ii) == element1)
863 else if (get(ii) == element2)
867 void swapIndices(t_index_type index_1, t_index_type index_2)
869 std::swap(get(index_1), get(index_2));
871 void move(t_index_type from, t_index_type to)
875 t_type object = get(from);
883 struct primitiveUniqueDataComparison
885 bool operator()(const t_type& lhs, const t_type& rhs)
887 return memcmp(&lhs, &rhs, sizeof(t_type)) > 0;
890 std::sort(begin(), end(), primitiveUniqueDataComparison());
894 std::sort(begin(), end());
896 void sortRange(t_index_type start, t_index_type end)
898 std::sort(begin() + start, begin() + end);
902 if constexpr (t_memory_allocator::isPrimitive())
906 removeAllIndex(cast<t_index_type>(std::unique(begin(), end()) - begin()), size());
908 void setUniquePresorted()
910 removeAllIndex(cast<t_index_type>(std::unique(begin(), end()) - begin()), size());
912 t_index_type sortAboutValue(t_index_type value_index)
914 return sortAboutValue(value_index, 0, size());
916 t_index_type sortAboutValue(t_index_type value_index, t_index_type start, t_index_type end)
918 const t_type value = get(value_index);
919 std::swap(get(value_index), get(--end));
920 t_index_type store = start;
921 for (t_index_type idx = start; idx < end; ++idx)
923 if (get(idx) <= value)
925 std::swap(get(idx), get(store));
929 std::swap(get(end), get(store));
932 inline Buffer& operator=(const Buffer& buffer)
934 if (&(buffer) == this)
935 return *this;//check to ensure not setting equal to ourselves
940 inline Buffer& operator=(Buffer&& buffer) noexcept
942 std::swap(m_memory_interface, buffer.m_memory_interface);
945 [[nodiscard]] inline bool operator==(const Buffer& buffer) const
947 return equals(buffer);
949 [[nodiscard]] inline bool operator>(const Buffer& buffer) const
951 return compare(buffer) > 0;
953 [[nodiscard]] inline bool operator<(const Buffer& buffer) const
955 return compare(buffer) < 0;
957 [[nodiscard]] inline bool operator>=(const Buffer& buffer) const
959 return compare(buffer) >= 0;
961 [[nodiscard]] inline bool operator<=(const Buffer& buffer) const
963 return compare(buffer) <= 0;
965 [[nodiscard]] inline bool operator!=(const Buffer& buffer) const
967 return !equals(buffer);
969 [[nodiscard]] decltype(auto) operator[](const t_index_type index)
973 [[nodiscard]] decltype(auto) operator[](const int index)
975 return get(cast<t_index_type>(index));
977 [[nodiscard]] decltype(auto) operator[](const t_index_type value) const
981 [[nodiscard]] decltype(auto) operator[](const int index) const
983 return get(cast<t_index_type>(index));
985 [[nodiscard]] Buffer operator+(const t_type& element) const
987 Buffer<t_type, t_memory_allocator, t_memory_manager> buffer(1 + size());
988 buffer.addAll(*this);
992 const Buffer& operator+=(const t_type& element)
997 inline Buffer& operator+=(const Buffer& value)
1002 [[nodiscard]] inline Buffer operator+(const Buffer& value) const
1004 Buffer buffer(size() + value.size());
1005 buffer.addAll(*this);
1006 buffer.addAll(value);
1009 [[nodiscard]] bool isSorted() const
1013 for (t_index_type i = 0; i < size() - 1; i++)
1015 if (get(i) >= get(i + 1))
1020 [[nodiscard]] bool isSortedSet() const
1022 for (t_index_type i = 0; i < size() - 1; i++)
1024 if (get(i) > get(i + 1))
1029 [[nodiscard]] constexpr static t_type Type() { t_type* ptr = nullptr; return *ptr; }
1031 [[nodiscard]] constexpr t_memory_manager& memoryInterface()
1033 return m_memory_interface;
1035 [[nodiscard]] constexpr const t_memory_manager& memoryInterface() const
1037 return m_memory_interface;
1040 template<bool t_is_primitive>
1041 [[nodiscard]] bool _equals(const Buffer& buffer) const
1045 return compare(buffer) == 0;
1049 for (t_index_type i = 0; i < size(); i++)
1051 if (get(i) != buffer.get(i))
1058 t_memory_manager m_memory_interface;
1060 template<class t_type, class t_memory_allocator, class t_memory_manager>
1061 struct Constant<Buffer<t_type, t_memory_allocator, t_memory_manager>>
1064 inline const static Buffer<t_type, t_memory_allocator, t_memory_manager> Invalid{};
1067#include "BoolBuffer.hpp
"
#define lib_assert(expression, message)
Definition LibAssert.h:61
Specific logic for reserving memory for a Buffer. When managed, and more memory is needed memory is r...
Definition Pointer.hpp:311
A dummy class for easy tracking of inheritance with templated Buffers.
Definition ObjectInfo.h:42
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
void add(t_index_type location, t_type &&object)
Adds an object to a specific location. Equivelent to insert.
Definition Buffer.hpp:216
decltype(auto) get(t_index_type index) const
Definition Buffer.hpp:546
constexpr Buffer()
Definition Buffer.hpp:61
bool equals(const Buffer &buffer) const
Definition Buffer.hpp:534
void add(t_type &&object)
Adds object to the end of the buffer.
Definition Buffer.hpp:186
void removeAllOrderedFn(const t_functor &functor)
Removes all items based on the functor. The functor should return true if the item is deleted or fals...
Definition Buffer.hpp:703
sint04 compare(const Buffer &value) const
Compares this Buffer to another to determine their relative ordering.
Definition Buffer.hpp:439
constexpr t_memory_manager & memoryInterface()
Definition Buffer.hpp:1031
void insert(t_index_type offset, const Buffer &buffer)
Definition Buffer.hpp:283
void addSpace(t_index_type space_to_add)
Adds a space to the end of the buffer.
Definition Buffer.hpp:366
void add(const t_type &object)
Adds object to the end of the buffer.
Definition Buffer.hpp:195
bool contains(const t_type &element) const
Definition Buffer.hpp:465
t_index_type lastIndexOf(const t_type &element) const
Definition Buffer.hpp:598
void addAll(const t_type *buffer)
Definition Buffer.hpp:271
decltype(auto) begin(t_index_type index) const
Definition Buffer.hpp:412
void removeAllUnordered(const t_type &object)
Removes all unordered described by object. This function does not preserve the order of the buffer.
Definition Buffer.hpp:641
void addAndFillSpace(t_index_type space_to_add, const t_type &fill_object)
Definition Buffer.hpp:373
t_index_type capacity() const
Definition Buffer.hpp:417
void setAll(const t_o_type *src, t_index_type offset, t_index_type size)
Definition Buffer.hpp:767
Buffer getAll(t_index_type start, t_index_type size)
Definition Buffer.hpp:553
constexpr t_index_type size() const
Definition Buffer.hpp:823
void removeAllOrdered(const t_type &object)
Removes all instances of the object. Function is slower than removeAllUnordered but order is preserve...
Definition Buffer.hpp:683
decltype(auto) ptr()
Definition Buffer.hpp:387
constexpr Buffer(Buffer &&buffer) noexcept
Definition Buffer.hpp:77
void removeAllIndex(t_index_type start, t_index_type end)
Definition Buffer.hpp:716
Buffer(std::initializer_list< t_type > l)
Definition Buffer.hpp:114
t_index_type indexOf(const t_type &element, t_index_type start_pos, t_index_type search_size) const
Definition Buffer.hpp:575
decltype(auto) last()
Definition Buffer.hpp:588
void addAll(const Buffer< t_type, t_other_index_type, t_other_memory_allocator, t_other_memory_manager > &buffer)
Definition Buffer.hpp:243
void addSpace(t_index_type location, t_index_type size)
Definition Buffer.hpp:380
void removeIndexBackSwap(t_index_type location)
Definition Buffer.hpp:612
decltype(auto) end()
Definition Buffer.hpp:507
void setSize(t_index_type new_size)
Definition Buffer.hpp:803
void replaceIndexRange(t_index_type offset, t_index_type replace_size, const Buffer &buffer)
Definition Buffer.hpp:296
t_index_type indexOf(const t_type &element) const
Definition Buffer.hpp:559
Buffer(const t_iterator &begin, const t_iterator &end)
Definition Buffer.hpp:124
void removeAllUnordered(const t_functor &functor)
Removes all items based on the functor. The functor should return true if the item is deleted or fals...
Definition Buffer.hpp:664
decltype(auto) end(t_index_type index)
Definition Buffer.hpp:515
void swapIndices(t_index_type index_1, t_index_type index_2)
Definition Buffer.hpp:867
void insert(t_index_type offset, const t_type *const buffer, t_index_type buffer_size)
Inserts data into the buffer.
Definition Buffer.hpp:327
sint04 compare(const Buffer &value, t_index_type start, t_index_type end) const
Definition Buffer.hpp:451
void insert(t_index_type location, const t_type &object)
Adds an object to a specific location.
Definition Buffer.hpp:227
void removeIndex(t_index_type location)
Definition Buffer.hpp:606
Buffer(t_index_type size)
Definition Buffer.hpp:85
void add(t_index_type location, const t_type &object)
Adds and object to a specific location. Equivelent to insert.
Definition Buffer.hpp:206
void ensureCapacity(t_index_type new_capacity, bool ensure_not_greater=false, bool ensure_not_less=true)
Definition Buffer.hpp:519
decltype(auto) ptr() const
Definition Buffer.hpp:392
Buffer< t_other_type, t_other_index_type, t_other_memory_allocator, t_other_memory_manager > getAs() const
Gets a copy of this buffer, with filled objects t_other_type, where all objects are created using the...
Definition Buffer.hpp:172
void insert(t_index_type location, t_type &&object)
Adds an object to a specific location.
Definition Buffer.hpp:237
void clear(t_index_type new_capacity)
Definition Buffer.hpp:427
decltype(auto) begin()
Definition Buffer.hpp:402
t_index_type memSize() const
Definition Buffer.hpp:397
Buffer(t_index_type size, const t_type &fill_object)
Definition Buffer.hpp:104
~Buffer()
Definition Buffer.hpp:143
bool contains(const t_type &element, const std::function< bool(const t_type &, const t_type &)> &equal_function) const
Definition Buffer.hpp:474
void clear()
Definition Buffer.hpp:422
Buffer(const t_type *buffer, t_index_type size)
Definition Buffer.hpp:94
decltype(auto) begin() const
Definition Buffer.hpp:407
bool isEmpty() const
Definition Buffer.hpp:584
decltype(auto) last() const
Definition Buffer.hpp:593
decltype(auto) get(t_index_type index)
Definition Buffer.hpp:541
bool contains(const t_type &element, t_index_type start) const
Definition Buffer.hpp:483
decltype(auto) end() const
Definition Buffer.hpp:511
void insert(const t_index_type location, const t_type *buffer)
Inserts data into the buffer, assumed to be null terminated.
Definition Buffer.hpp:348
bool removeElement(const t_type &element)
Definition Buffer.hpp:617
t_index_type indexOf(const t_type &element, t_index_type start_pos) const
Definition Buffer.hpp:567
t_index_type count(const t_type &element) const
Definition Buffer.hpp:503
void removeLast()
Definition Buffer.hpp:629
void addAll(const t_type *buffer, t_index_type buffer_size)
Definition Buffer.hpp:257
bool contains(const t_type &element, t_index_type start, t_index_type search_size) const
Definition Buffer.hpp:493
constexpr Buffer(const Buffer &buffer)
Definition Buffer.hpp:68
int32_t sint04
-Defines an alias representing a 4 byte, signed integer. -Can represent exact integer values -2147483...
Definition BaseValues.hpp:64
constexpr bool IsInvalid(const t_type &value)
Query if 'value' is valid or invalid. Invalid values should return invalid if used for calculations o...
Definition BaseFunctions.hpp:170
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
constexpr t_to cast(const Angle< t_from > &value)
Definition Angle.h:375
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233