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

#include <Worklist.hpp>

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

Public Member Functions

 ~Workset () override=default
 
 Workset ()=default
 
bool HasMoreWorkItems () const noexcept override
 
PopWorkItem () override
 
void PushWorkItem (T item) override
 
bool HasWorkItem (T item) const noexcept
 
void RemoveWorkItem (T item)
 
- 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 > PushedItems_
 

Detailed Description

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

A fake worklist that remembers which work items have been pushed, but without providing any kind of iteration interface for accessing them. Each work item must be explicitly removed by name. Used to implement the Topological worklist policy, which is not technically a worklist policy.

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

Definition at line 306 of file Worklist.hpp.

Constructor & Destructor Documentation

◆ ~Workset()

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

◆ Workset()

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

Member Function Documentation

◆ HasMoreWorkItems()

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

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

Definition at line 314 of file Worklist.hpp.

◆ HasWorkItem()

template<typename T >
bool jlm::util::Workset< T >::HasWorkItem ( item) const
inlinenoexcept

Definition at line 332 of file Worklist.hpp.

◆ PopWorkItem()

template<typename T >
T jlm::util::Workset< 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 320 of file Worklist.hpp.

◆ PushWorkItem()

template<typename T >
void jlm::util::Workset< 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 326 of file Worklist.hpp.

◆ RemoveWorkItem()

template<typename T >
void jlm::util::Workset< T >::RemoveWorkItem ( item)
inline

Definition at line 338 of file Worklist.hpp.

Member Data Documentation

◆ PushedItems_

template<typename T >
util::HashSet<T> jlm::util::Workset< T >::PushedItems_
private

Definition at line 344 of file Worklist.hpp.


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