33#include <NDEVR/Buffer.h>
47 template <
class t_type,
class t_buffer>
138 template<
class t_type,
class t_memory_manager>
143 auto final_iter = std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), iter);
144 intersect_buf.setSize(
cast<uint04>(final_iter - intersect_buf.begin()));
145 return intersect_buf;
153 template<
class t_type,
class t_memory_manager>
156 lib_assert(a.isSorted(),
"A is not sorted");
157 lib_assert(b.isSorted(),
"B is not sorted");
164 std::set_difference(a.begin(), a.end(), b.begin(), b.end(), iter);
165 return intersect_buf;
174 template<
class t_type,
class t_memory_manager>
180 union_buf.makeUnique();
190 template<
class t_type,
class t_memory_manager>
197 a_sorted.setUniquePresorted();
198 b_sorted.setUniquePresorted();
207 template<
class t_type,
class t_memory_manager>
213 if (!b.contains(a[i]))
214 intersect_buf.removeIndex(i);
216 return intersect_buf;
224 template<
class t_type,
class t_memory_manager>
231 a_sorted.setUniquePresorted();
232 b_sorted.setUniquePresorted();
A dummy class to include complex Buffer insert and sort functions Functions that enhance the function...
Used by stl library to insert objects into the buffer.
ptrdiff_t difference_type
Type used for iterator difference calculations.
BufferInsertIterator< t_type, t_buffer > & operator++()
Pre-increment operator.
t_type & reference
Reference type for the value type.
BufferInsertIterator(t_buffer &container, int i)
Constructs a BufferInsertIterator at a given position.
BufferInsertIterator< t_type, t_buffer > & operator++(int val)
Post-increment operator.
const BufferInsertIterator< t_type, t_buffer > & operator*() const
Const dereference operator.
uint04 m_location
Current insertion index within the buffer.
std::random_access_iterator_tag iterator_category
STL iterator category tag.
t_buffer * m_container
Pointer to the buffer being inserted into.
BufferInsertIterator< t_type, t_buffer > & operator*()
Dereference operator.
t_type * pointer
Pointer type for the value type.
BufferInsertIterator< t_type, t_buffer > & operator=(t_type &&value)
Moves the given value into the buffer at the current location and advances the iterator.
t_type value_type
The type of elements being inserted.
BufferInsertIterator< t_type, t_buffer > & operator=(const t_type &value)
Inserts a copy of the given value at the current location and advances the iterator.
The equivelent of std::vector but with a bit more control.
The primary namespace for the NDEVR SDK.
constexpr t_type getMin(const t_type &left, const t_type &right)
Finds the minimum of the given arguments based on the < operator Author: Tyler Parke Date: 2017-11-05...
static constexpr bool IsValid(const Angle< t_type > &value)
Checks whether the given Angle holds a valid value.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Buffer< t_type, t_memory_manager > Except(const Buffer< t_type, t_memory_manager > &a, const Buffer< t_type, t_memory_manager > &b)
Returns elements in buffer a that are not in buffer b, sorting both buffers first.
Buffer< t_type, t_memory_manager > IntersectPreserveOrderA(const Buffer< t_type, t_memory_manager > &a, const Buffer< t_type, t_memory_manager > &b)
Computes the intersection of two buffers while preserving the order of elements from buffer a.
Buffer< t_type, t_memory_manager > Union(const Buffer< t_type, t_memory_manager > &a, const Buffer< t_type, t_memory_manager > &b)
Computes the union of two buffers, removing duplicate elements.
Buffer< t_type, t_memory_manager > Intersect(const Buffer< t_type, t_memory_manager > &a, const Buffer< t_type, t_memory_manager > &b)
Computes the intersection of two unsorted buffers by sorting them first.
Buffer< t_type, t_memory_manager > IntersectSorted(const Buffer< t_type, t_memory_manager > &a, const Buffer< t_type, t_memory_manager > &b)
Computes the intersection of two pre-sorted buffers using std::set_intersection.
Buffer< t_type, t_memory_manager > ExceptSorted(const Buffer< t_type, t_memory_manager > &a, const Buffer< t_type, t_memory_manager > &b)
Returns the elements from sorted buffer a which are not found in sorted buffer b.
constexpr t_to cast(const Angle< t_from > &value)
Casts an Angle from one backing type to another.