A data structure that allows appending at the back and invalidating from the front.
More...
|
| Queue (const std::string &name, const uint32_t num_entries, const Clock *clk, StatisticSet *statset=nullptr, InstrumentationNode::visibility_t stat_vis_general=InstrumentationNode::AUTO_VISIBILITY, InstrumentationNode::visibility_t stat_vis_detailed=InstrumentationNode::VIS_HIDDEN, InstrumentationNode::visibility_t stat_vis_max=InstrumentationNode::AUTO_VISIBILITY, InstrumentationNode::visibility_t stat_vis_avg=InstrumentationNode::AUTO_VISIBILITY) |
| Construct a queue.
|
|
| ~Queue () |
| Destroy the Queue, clearing everything out.
|
|
| Queue (const Queue< value_type > &)=delete |
| No copies, no moves.
|
|
Queue & | operator= (const Queue< value_type > &)=delete |
| Deleting default assignment operator to prevent copies.
|
|
const std::string & | getName () const |
| Name of this resource.
|
|
bool | isValid (uint32_t idx) const |
| Determine if data at the index is valid.
|
|
const value_type & | read (uint32_t idx) const |
| Read and return the data at the given index, const reference.
|
|
value_type & | access (uint32_t idx) |
| Read and return the data at the given index, reference, non-const method.
|
|
value_type & | front () const |
| Read and return the data at the front(oldest element), reference.
|
|
value_type & | back () const |
| Read and return the last pushed in element(newest element), reference.
|
|
uint32_t | capacity () const |
| Return the fixed size of this queue.
|
|
size_type | size () const |
| Return the number of valid entries.
|
|
size_type | numFree () const |
| Return the number of free entries.
|
|
bool | empty () const |
| Return if the queue is empty or not.
|
|
void | clear () |
| Empty the queue.
|
|
void | enableCollection (TreeNode *parent) |
| Request that this queue begin collecting its contents for pipeline collection.
|
|
iterator | push (const value_type &dat) |
| push data to the Queue.
|
|
iterator | push (value_type &&dat) |
| push data to the Queue.
|
|
void | pop () |
| Pops the data at the front of the structure (oldest element) After pop iterator always points to the last element.
|
|
void | pop_back () |
| Pops the data at the back of the structure (newest element) After pop iterator always points to the last element.
|
|
iterator | begin () |
| STL-like begin operation, starts at front (oldest element)
|
|
iterator | end () |
| STL - like end operation, starts at element one past head.
|
|
const_iterator | begin () const |
| STL-like begin operation, starts at front (oldest element)
|
|
const_iterator | end () const |
| STL - like end operation, starts at element one past head.
|
|
template<class DataT>
class sparta::Queue< DataT >
A data structure that allows appending at the back and invalidating from the front.
The Queue allows user to push data to the back of the queue and pop it from the front.
The queue does not manage any type of state delaying. In order to use the queue as a present state/next state queue, the user should use delays when writing to the queue's ports or listening to the queue's ports.
The only precedence that the Queue follows is that invalidations precede writes.
The queue can also be used without the port mechanism via public methods push and pop. The pop method is special in that it will return an iterator which points to that entry in Queue. At any time the queue entry can be queried for that data's location in the queue via its public getIndex() method.
Example usage
assert(entry < entry2);
Class that alows queue elements to be accessed like a normal stl iterator. Queue iterator is a bidire...
uint32_t getIndex() const
A data structure that allows appending at the back and invalidating from the front.
const value_type & read(uint32_t idx) const
Read and return the data at the given index, const reference.
iterator push(const value_type &dat)
push data to the Queue.
void pop()
Pops the data at the front of the structure (oldest element) After pop iterator always points to the ...
Definition at line 69 of file Queue.hpp.