FreeNOS
|
Containers provide access to stored items. More...
#include <Container.h>
Public Member Functions | |
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 void | clear ()=0 |
Removes all items from 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... | |
Containers provide access to stored items.
Definition at line 35 of file Container.h.
Container::Container | ( | ) |
Constructor.
Definition at line 20 of file Container.cpp.
|
virtual |
Destructor.
Definition at line 24 of file Container.cpp.
|
pure virtual |
Removes all items from the Container.
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 * >, Queue< T, N >, Queue< Process *, MAX_PROCS >, Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets >, Sequence< T >, Sequence< String * >, Sequence< Handler * >, Sequence< Size >, Sequence< MpiHost::Packet * >, Sequence< TestInstance * >, Sequence< FileSystemRequest * >, Sequence< InterruptHook * >, Sequence< String >, Sequence< Dirent * >, Sequence< ProcessID >, Sequence< List< InterruptHook * > * >, Sequence< Process * >, Sequence< HashTable::Bucket >, Sequence< LinnGroup * >, Sequence< List< HashTable::Bucket > >, Sequence< List< Process * > * >, Sequence< char >, Sequence< Argument * >, Sequence< uint >, Sequence< K >, Sequence< Device * >, Sequence< ATADrive * >, Associative< K, V >, Associative< u32, LinnInode * >, Associative< IPV4::Address, ARP::ARPCache * >, Associative< u32, File * >, Associative< String, ShellCommand * >, Associative< u16, UDPSocket * >, Associative< ProcessID, Channel * >, Associative< String, Argument * >, Associative< ProcessID, HashTable< String, Address > * >, and Associative< String, FileCache * >.
|
pure virtual |
Returns the number of items inside the Container.
Implemented in List< T >, HashTable< K, V >, Vector< T >, Queue< T, N >, Array< T, N >, and String.
Referenced by Sequence< ATADrive * >::compareTo(), Associative< String, FileCache * >::compareTo(), and isEmpty().
|
virtual |
Check if the Container is empty.
Reimplemented in List< T >.
Definition at line 28 of file Container.cpp.
References count().
|
virtual |
|
virtual |
Change the size of the Container.
size | New size of the container. |
Reimplemented in Vector< T >, Vector< Handler * >, Vector< Size >, Vector< List< InterruptHook * > * >, Vector< LinnGroup * >, Vector< List< HashTable::Bucket > >, Vector< List< Process * > * >, Vector< Argument * >, and String.
Definition at line 51 of file Container.cpp.
|
virtual |
Shrink the container size by the given amount of items.
size | Number of items to shrink. |
Definition at line 41 of file Container.cpp.
|
pure virtual |
Returns the maximum size of this Container.
Implemented in List< T >, HashTable< K, V >, Vector< T >, Queue< T, N >, Array< T, N >, and String.
Referenced by Sequence< ATADrive * >::clear(), Sequence< ATADrive * >::compareTo(), Associative< String, FileCache * >::compareTo(), Sequence< ATADrive * >::contains(), Sequence< ATADrive * >::fill(), reserve(), shrink(), and squeeze().
|
virtual |
Try to minimize the memory required in the Container.
Definition at line 46 of file Container.cpp.
References size().