Jlm
Public Member Functions | Private Attributes | List of all members
jlm::util::LifoWorklist< T > Class Template Referencefinal

#include <Worklist.hpp>

Inheritance diagram for jlm::util::LifoWorklist< T >:
Inheritance graph
[legend]
Collaboration diagram for jlm::util::LifoWorklist< T >:
Collaboration graph
[legend]

Public Member Functions

 ~LifoWorklist () override=default
 
 LifoWorklist ()=default
 
bool HasMoreWorkItems () const noexcept override
 
PopWorkItem () override
 
void PushWorkItem (T item) override
 
- Public Member Functions inherited from jlm::util::Worklist< T >
virtual ~Worklist ()=default
 
 Worklist ()=default
 
 Worklist (const Worklist &other)=delete
 
 Worklist (Worklist &&other)=default
 
Worklistoperator= (const Worklist &other)=delete
 
Worklistoperator= (Worklist &&other)=default
 

Private Attributes

util::HashSet< T > OnList_
 
std::stack< T > WorkItems_
 

Detailed Description

template<typename T>
class jlm::util::LifoWorklist< T >

Worklist implementation using a stack. Pushing a work item that is already on the stack is a no-op.

Template Parameters
Tthe type of the work items.
See also
Worklist

Definition at line 74 of file Worklist.hpp.

Constructor & Destructor Documentation

◆ ~LifoWorklist()

template<typename T >
jlm::util::LifoWorklist< T >::~LifoWorklist ( )
overridedefault

◆ LifoWorklist()

template<typename T >
jlm::util::LifoWorklist< T >::LifoWorklist ( )
default

Member Function Documentation

◆ HasMoreWorkItems()

template<typename T >
bool jlm::util::LifoWorklist< T >::HasMoreWorkItems ( ) const
inlineoverridevirtualnoexcept
Returns
true if there are work items left to be visited

Implements jlm::util::Worklist< T >.

Definition at line 82 of file Worklist.hpp.

◆ PopWorkItem()

template<typename T >
T jlm::util::LifoWorklist< T >::PopWorkItem ( )
inlineoverridevirtual

Removes one work item from the worklist. Requires there to be at least one work item left.

Returns
the removed work item.

Implements jlm::util::Worklist< T >.

Definition at line 88 of file Worklist.hpp.

◆ PushWorkItem()

template<typename T >
void jlm::util::LifoWorklist< T >::PushWorkItem ( item)
inlineoverridevirtual

Adds a work item to the worklist. If the item is already present, the item is not added again, but its position may be changed.

Parameters
itemthe work item to be added.

Implements jlm::util::Worklist< T >.

Definition at line 98 of file Worklist.hpp.

Member Data Documentation

◆ OnList_

template<typename T >
util::HashSet<T> jlm::util::LifoWorklist< T >::OnList_
private

Definition at line 106 of file Worklist.hpp.

◆ WorkItems_

template<typename T >
std::stack<T> jlm::util::LifoWorklist< T >::WorkItems_
private

Definition at line 109 of file Worklist.hpp.


The documentation for this class was generated from the following file: