|
iterator | getCircularIterator (uint32_t idx=0) |
| Get an iterator that is circular on the Array (has no end())
|
|
iterator | getUnitializedIterator () |
| Provide a method to get an uninitialized iterator.
|
|
iterator | begin () |
| STL-like begin operation, starts at index 0 (ignores valid bit).
|
|
const_iterator | begin () const |
| STL-like begin operation, const, starts at index 0 (ignores valid bit).
|
|
iterator | end () |
| STL-like end operation.
|
|
const_iterator | end () const |
| STL-like end operation, const.
|
|
iterator | abegin () |
| STL-like begin operation, starts at the oldest valid index.
|
|
const_iterator | abegin () const |
| STL-like begin operation, const, starts at the oldest valid index.
|
|
iterator | aend () |
| STL-like end operation.
|
|
const_iterator | aend () const |
| STL-like end operation, const.
|
|
| Array (const std::string &name, 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 an array.
|
|
virtual | ~Array () |
| Virtual destructor.
|
|
const std::string & | getName () const |
| Name of this resource.
|
|
bool | isValid (const uint32_t idx) const |
| Determine whether an index is currently valid.
|
|
const DataT & | read (const uint32_t idx) const |
| Read (only) the data at an index.
|
|
DataT & | access (const uint32_t idx) |
| Access (writeable) the data at a position.
|
|
const_iterator | getOldestIndex (const uint32_t nth=0) const |
| Return the oldest index in the array.
|
|
const_iterator | getYoungestIndex (const uint32_t nth=0) const |
| provide access the youngest index in the array.
|
|
bool | getNextOldestIndex (uint32_t &prev_idx) const |
| Sets the input argument to the index containing the location of the next oldest item after input argument. If the input argument is the youngest index, we return false.
|
|
uint32_t | getAge (const uint32_t idx) const |
| Provide the age information of the given entry index.
|
|
const AgedList & | getAgedList () const |
| Provide access to our aged_list_ internals.
|
|
size_type | capacity () const |
| Return the maximum number of elements this Array can hold.
|
|
size_type | numValid () const |
| The number of valid entries contained.
|
|
size_type | size () const |
|
size_type | numFree () const |
| The number of free entries.
|
|
void | erase (const iterator &iter) |
| Invalidate data at an iterator position.
|
|
void | erase (const uint32_t &idx) |
| Invalidate the entry at a certain index.
|
|
void | clear () |
| Clear the array of all data.
|
|
void | write (const uint32_t idx, const DataT &dat) |
| Write data to the array.
|
|
void | write (const uint32_t idx, DataT &&dat) |
| Write data to the array.
|
|
void | write (const iterator &iter, const DataT &dat) |
| Write data at an iterator position.
|
|
void | write (const iterator &iter, DataT &&dat) |
| Write data at an iterator position.
|
|
bool | isYounger (uint32_t lhs, uint32_t rhs) |
| Determine if an index was written (using write()) to the Array after another index.
|
|
bool | isOlder (uint32_t lhs, uint32_t rhs) |
| Determine if an index was written (using write()) to the Array before another index.
|
|
void | enableCollection (TreeNode *parent) |
| Set up a auto-collector for this Array.
|
|
template<class DataT,
ArrayType ArrayT = ArrayType::AGED>
class sparta::Array< DataT, ArrayT >
Array is essentially a fixed size vector, maintains a concept of validity of its indexes, and provides access via stl iteration and general get methods.
- Template Parameters
-
The Array class maintains a list of elements, constrained to the number of entries, allowing a user to add/remove entries from the middle, beginning, or end without collapsing. If the template parameter ArrayType::AGED is provided (default), the array will keep track of the age of the internal components.
The methods begin() and end() will return iterators to the array, with begin() always returning an iterator pointing to index 0 and end() pointing beyond it. The iterator might not be pointing to valid data, so a call to isValid() on the iterator is required before dereferencing.
To iterator over the aged list, use the methods abegin() and aend().
Definition at line 57 of file Array.hpp.