FreeNOS
|
This is a wrapper class for a fixed size array. More...
#include <Array.h>
Public Member Functions | |
Array () | |
Default constructor. More... | |
Array (const Array< T, N > &a) | |
Copy constructor. More... | |
virtual bool | insert (Size position, const T &item) |
Puts the given item at the given position. More... | |
virtual const T * | get (Size position) const |
Returns the item at the given position. More... | |
virtual const T & | at (Size position) const |
Returns a reference to the item at the given position. More... | |
virtual const T | value (Size position) const |
Return value at the given position. More... | |
virtual Size | size () const |
Returns the maximum size of this Array. More... | |
virtual Size | count () const |
Returns the number of items in the Array. More... | |
Public Member Functions inherited from Sequence< T > | |
virtual int | insert (const T &item) |
Adds the given item to the Sequence, if possible. More... | |
virtual void | fill (T value) |
Fill the Sequence with the given value. More... | |
virtual int | remove (T value) |
Remove all items with the given value. More... | |
virtual bool | removeAt (Size position) |
Removes the item at the given position. More... | |
virtual void | clear () |
Removes all items from the Sequence. More... | |
virtual bool | contains (const T value) const |
Check if the given item is stored in this Sequence. More... | |
virtual int | compareTo (const Sequence< T > &s) const |
Compare this Sequence to another Sequence. More... | |
virtual bool | equals (const Sequence< T > &s) const |
Test if this Sequence is equal to an other Sequence. More... | |
const T & | operator[] (int i) const |
Returns the item at the given position in the Sequence. More... | |
const T & | operator[] (Size i) const |
Returns the item at the given position in the Sequence. More... | |
T & | operator[] (int i) |
Returns the item at the given position in the Sequence. More... | |
T & | operator[] (Size i) |
Returns the item at the given position in the Sequence. More... | |
Public Member Functions inherited from Container | |
Container () | |
Constructor. More... | |
virtual | ~Container () |
Destructor. More... | |
virtual bool | isEmpty () const |
Check if the Container is empty. More... | |
virtual bool | reserve (Size size) |
Ensure that at least the given size is available. More... | |
virtual bool | shrink (Size size) |
Shrink the container size by the given amount of items. More... | |
virtual Size | squeeze () |
Try to minimize the memory required in the Container. More... | |
virtual bool | resize (Size size) |
Change the size of the Container. More... | |
Public Member Functions inherited from Comparable< Sequence< T > > | |
virtual | ~Comparable () |
Class destructor. More... | |
Private Attributes | |
T | m_array [N] |
The actual array where the data is stored. More... | |
This is a wrapper class for a fixed size array.
This class contains some extra functionality, somewhat like the Arrays class in Java.
Returns a reference to the item at the given position.
Note that this function does not perform bounds checking. Position must be a valid index.
position | Valid index inside this array. |
Implements Sequence< T >.
Returns the item at the given position.
position | The position of the item to get. |
Implements Sequence< T >.
|
inlinevirtual |
Puts the given item at the given position.
If an item exists at the given position, it will be replaced by the given item.
position | The position to insert the item. |
item | The item to put |
Reimplemented from Sequence< T >.
Definition at line 74 of file Array.h.
Referenced by MpiProxy::processTerminate(), MpiProxy::startLocalProcess(), and MpiProxy::startRemoteProcess().
|
private |
The actual array where the data is stored.
Definition at line 156 of file Array.h.
Referenced by Array< ProcessID, MaximumChannels >::Array(), Array< ProcessID, MaximumChannels >::at(), Array< ProcessID, MaximumChannels >::get(), Array< ProcessID, MaximumChannels >::insert(), and Array< ProcessID, MaximumChannels >::value().