FreeNOS
|
Sequences are containers that provide indexed based storage of items. More...
#include <Sequence.h>
Public Member Functions | |
virtual int | insert (const T &item) |
Adds the given item to the Sequence, if possible. More... | |
virtual bool | insert (Size position, const T &item) |
Inserts the given item at the given position. 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 const T * | get (Size position) const =0 |
Returns the item at the given position. More... | |
virtual const T & | at (Size position) const =0 |
Returns a reference to the item at the given position. 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 Size | size () const =0 |
Returns the maximum size of this Container. More... | |
virtual Size | count () const =0 |
Returns the number of items inside the Container. 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... | |
Sequences are containers that provide indexed based storage of items.
Definition at line 37 of file Sequence.h.
Returns a reference to the item at the given position.
position | Valid index inside this array. |
Implemented in List< T >, List< String * >, List< MpiHost::Packet * >, List< TestInstance * >, List< FileSystemRequest * >, List< InterruptHook * >, List< String >, List< Dirent * >, List< Process * >, List< HashTable::Bucket >, List< uint >, List< K >, List< Device * >, List< ATADrive * >, Vector< T >, Vector< Handler * >, Vector< Size >, Vector< List< InterruptHook * > * >, Vector< LinnGroup * >, Vector< List< HashTable::Bucket > >, Vector< List< Process * > * >, Vector< Argument * >, Array< T, N >, Array< ProcessID, MaximumChannels >, and String.
Referenced by Sequence< ATADrive * >::compareTo(), Sequence< ATADrive * >::contains(), and Sequence< ATADrive * >::operator[]().
|
inlinevirtual |
Removes all items from the Sequence.
Implements Container.
Reimplemented in List< T >, List< String * >, List< MpiHost::Packet * >, List< TestInstance * >, List< FileSystemRequest * >, List< InterruptHook * >, List< String >, List< Dirent * >, List< Process * >, List< HashTable::Bucket >, List< uint >, List< K >, List< Device * >, List< ATADrive * >, Vector< T >, Vector< Handler * >, Vector< Size >, Vector< List< InterruptHook * > * >, Vector< LinnGroup * >, Vector< List< HashTable::Bucket > >, Vector< List< Process * > * >, and Vector< Argument * >.
Definition at line 108 of file Sequence.h.
|
inlinevirtual |
Compare this Sequence to another Sequence.
Implements Comparable< Sequence< T > >.
Definition at line 153 of file Sequence.h.
Referenced by Sequence< ATADrive * >::equals().
|
inlinevirtual |
Check if the given item is stored in this Sequence.
Reimplemented in List< uint >, List< TestInstance * >, List< T >, List< String >, List< String * >, List< Process * >, List< MpiHost::Packet * >, List< K >, List< InterruptHook * >, List< HashTable::Bucket >, List< FileSystemRequest * >, List< Dirent * >, List< Device * >, String, and List< ATADrive * >.
Definition at line 139 of file Sequence.h.
|
inlinevirtual |
Test if this Sequence is equal to an other Sequence.
s | Sequence instance. |
Implements Comparable< Sequence< T > >.
Definition at line 184 of file Sequence.h.
|
inlinevirtual |
Fill the Sequence with the given value.
value | New value to fill the Sequence. |
Definition at line 73 of file Sequence.h.
Referenced by API::API(), Kernel::Kernel(), LinnFileSystem::LinnFileSystem(), MpiProxy::MpiProxy(), and ProcessManager::ProcessManager().
Returns the item at the given position.
position | The position of the item to get. |
Implemented in List< T >, List< String * >, List< MpiHost::Packet * >, List< TestInstance * >, List< FileSystemRequest * >, List< InterruptHook * >, List< String >, List< Dirent * >, List< Process * >, List< HashTable::Bucket >, List< uint >, List< K >, List< Device * >, List< ATADrive * >, Vector< T >, Vector< Handler * >, Vector< Size >, Vector< List< InterruptHook * > * >, Vector< LinnGroup * >, Vector< List< HashTable::Bucket > >, Vector< List< Process * > * >, Vector< Argument * >, Array< T, N >, Array< ProcessID, MaximumChannels >, and String.
|
inlinevirtual |
Adds the given item to the Sequence, if possible.
item | The item to add to the Sequence. |
Reimplemented in Vector< T >, Vector< Size >, Vector< List< Process * > * >, Vector< List< InterruptHook * > * >, Vector< List< HashTable::Bucket > >, Vector< LinnGroup * >, Vector< Handler * >, and Vector< Argument * >.
Definition at line 48 of file Sequence.h.
Referenced by Sequence< ATADrive * >::fill().
|
inlinevirtual |
Inserts 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 insert |
Reimplemented in Vector< T >, Array< T, N >, Vector< Size >, Array< ProcessID, MaximumChannels >, Vector< List< Process * > * >, Vector< List< InterruptHook * > * >, Vector< List< HashTable::Bucket > >, Vector< LinnGroup * >, Vector< Handler * >, and Vector< Argument * >.
Definition at line 63 of file Sequence.h.
|
inline |
Returns the item at the given position in the Sequence.
i | The index of the item to return. |
Definition at line 220 of file Sequence.h.
|
inline |
Returns the item at the given position in the Sequence.
i | The index of the item to return. |
Definition at line 196 of file Sequence.h.
Returns the item at the given position in the Sequence.
i | The index of the item to return. |
Definition at line 232 of file Sequence.h.
Returns the item at the given position in the Sequence.
i | The index of the item to return. |
Definition at line 208 of file Sequence.h.
|
inlinevirtual |
Remove all items with the given value.
value | Value to remove. |
Reimplemented in List< uint >, List< TestInstance * >, List< T >, List< String >, List< String * >, List< Process * >, List< MpiHost::Packet * >, List< K >, List< InterruptHook * >, List< HashTable::Bucket >, List< FileSystemRequest * >, List< Dirent * >, List< Device * >, and List< ATADrive * >.
Definition at line 88 of file Sequence.h.
Removes the item at the given position.
position | The position of the item to remove. |
Reimplemented in Vector< T >, Vector< Handler * >, Vector< Size >, Vector< List< InterruptHook * > * >, Vector< LinnGroup * >, Vector< List< HashTable::Bucket > >, Vector< List< Process * > * >, and Vector< Argument * >.
Definition at line 100 of file Sequence.h.
Referenced by Sequence< ATADrive * >::clear().