18#ifndef itkPriorityQueueContainer_h
19#define itkPriorityQueueContainer_h
35template <
typename TElement,
typename TElementIdentifier = IdentifierType>
54 [[nodiscard]]
virtual bool
57 [[nodiscard]]
virtual bool
69template <
typename TElementWrapperPo
inter,
typename TElementIdentifier = IdentifierType>
105template <
typename TElement,
typename TElementPriority =
double,
typename TElementIdentifier = IdentifierType>
107 :
public ElementWrapperInterface<MinPriorityQueueElementWrapper<TElement, TElementPriority, TElementIdentifier>,
155template <
typename TElement,
typename TElementPriority =
double,
typename TElementIdentifier = IdentifierType>
187template <
typename TElementWrapper,
188 typename TElementWrapperInterface,
189 typename TElementPriority = double,
209 template <
typename TInputIterator>
213 TInputIterator it = first;
257 inline ElementWrapperType &
260 return this->operator[](identifier);
263 inline const ElementWrapperType &
266 return this->operator[](identifier);
272 this->operator[](identifier) = element;
276 inline ElementIdentifierType
279 return (identifier - 1) >> 1;
282 inline ElementIdentifierType
285 return (identifier << 1) + 1;
288 inline ElementIdentifierType
291 return (identifier << 1) + 2;
311#include "itkPriorityQueueContainer.hxx"
static const ElementIdentifierType m_ElementNotFound
virtual bool is_greater(const ElementType &element1, const ElementType &element2) const =0
virtual ~ElementWrapperInterface()=default
TElementIdentifier ElementIdentifierType
ElementWrapperInterface()=default
ITK_DEFAULT_COPY_AND_MOVE(ElementWrapperInterface)
virtual void SetLocation(ElementType &element, const ElementIdentifierType &identifier)=0
virtual bool is_less(const ElementType &element1, const ElementType &element2) const =0
virtual ElementIdentifierType GetLocation(const ElementType &element) const =0
virtual ~ElementWrapperPointerInterface()=default
ITK_DEFAULT_COPY_AND_MOVE(ElementWrapperPointerInterface)
virtual bool is_less(const ElementWrapperPointerType &element1, const ElementWrapperPointerType &element2) const
void SetLocation(ElementWrapperPointerType &element, const ElementIdentifierType &identifier)
TElementIdentifier GetLocation(const ElementWrapperPointerType &element) const
virtual bool is_greater(const ElementWrapperPointerType &element1, const ElementWrapperPointerType &element2) const
TElementWrapperPointer ElementWrapperPointerType
ElementWrapperPointerInterface()=default
static const ElementIdentifierType m_ElementNotFound
TElementIdentifier ElementIdentifierType
TElementIdentifier ElementIdentifierType
bool is_greater(const Superclass &element1, const Superclass &element2) const override
MaxPriorityQueueElementWrapper()=default
MinPriorityQueueElementWrapper< ElementType, ElementPriorityType, ElementIdentifierType > Superclass
TElementPriority ElementPriorityType
bool is_less(const Superclass &element1, const Superclass &element2) const override
MaxPriorityQueueElementWrapper(ElementType element, ElementPriorityType priority)
virtual bool is_greater(const MaxPriorityQueueElementWrapper &element1, const MaxPriorityQueueElementWrapper &element2) const
virtual bool is_less(const MaxPriorityQueueElementWrapper &element1, const MaxPriorityQueueElementWrapper &element2) const
bool is_greater(const MinPriorityQueueElementWrapper &element1, const MinPriorityQueueElementWrapper &element2) const override
bool operator>(const MinPriorityQueueElementWrapper &other) const
ElementIdentifierType m_Location
bool operator==(const MinPriorityQueueElementWrapper &other) const
bool is_less(const MinPriorityQueueElementWrapper &element1, const MinPriorityQueueElementWrapper &element2) const override
bool operator<(const MinPriorityQueueElementWrapper &other) const
TElementIdentifier ElementIdentifierType
MinPriorityQueueElementWrapper< TElement, TElementPriority, TElementIdentifier > Superclass
MinPriorityQueueElementWrapper()=default
ElementIdentifierType GetLocation(const MinPriorityQueueElementWrapper &element) const override
ElementPriorityType m_Priority
void SetLocation(MinPriorityQueueElementWrapper &element, const ElementIdentifierType &identifier) override
TElementPriority ElementPriorityType
MinPriorityQueueElementWrapper(ElementType element, ElementPriorityType priority)
ElementWrapperType & GetElementAtLocation(const ElementIdentifierType &identifier)
void UpdateDownTree(const ElementIdentifierType &identifier)
TElementWrapperInterface ElementInterfaceType
ElementIdentifierType GetParent(const ElementIdentifierType &identifier) const
SmartPointer< const Self > ConstPointer
VectorContainer< TElementIdentifier, TElementWrapper > Superclass
bool HasParent(const ElementIdentifierType &iId) const
ElementInterfaceType m_Interface
PriorityQueueContainer()=default
bool DeleteElement(const ElementWrapperType &element)
void UpdateUpTree(const ElementIdentifierType &identifier)
TElementWrapper ElementWrapperType
PriorityQueueContainer Self
ElementIdentifierType GetRight(const ElementIdentifierType &identifier) const
bool Update(const ElementWrapperType &element)
~PriorityQueueContainer() override=default
void SetElementAtLocation(const ElementIdentifierType &identifier, ElementWrapperType &element)
SmartPointer< Self > Pointer
static const ElementIdentifierType m_ElementNotFound
const ElementWrapperType & Peek() const
ElementIdentifierType GetLeft(const ElementIdentifierType &identifier) const
void Push(ElementWrapperType element)
PriorityQueueContainer(TInputIterator first, TInputIterator last)
TElementIdentifier ElementIdentifierType
const ElementWrapperType & GetElementAtLocation(const ElementIdentifierType &identifier) const
Implements transparent reference counting.
VectorContainer()=default
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType