FreeNOS
Public Member Functions
Container Class Referenceabstract

Containers provide access to stored items. More...

#include <Container.h>

Inheritance diagram for Container:
Associative< K, V > Associative< IPV4::Address, ARP::ARPCache * > Associative< ProcessID, Channel * > Associative< ProcessID, HashTable< String, Address > * > Associative< String, Argument * > Associative< String, FileCache * > Associative< String, ShellCommand * > Associative< u16, UDPSocket * > Associative< u32, File * > Associative< u32, LinnInode * > Queue< T, N > Queue< NetworkQueue::Packet *, NetworkQueue::MaxPackets > Queue< Process *, MAX_PROCS > Sequence< T > Sequence< Argument * > Sequence< ATADrive * > Sequence< char > Sequence< Device * > Sequence< Dirent * > Sequence< FileSystemRequest * > Sequence< Handler * > Sequence< HashTable::Bucket > Sequence< InterruptHook * > Sequence< K > Sequence< LinnGroup * > Sequence< List< HashTable::Bucket > > Sequence< List< InterruptHook * > * > Sequence< List< Process * > * > Sequence< MpiHost::Packet * > Sequence< Process * > Sequence< ProcessID > Sequence< Size > Sequence< String * > Sequence< String > Sequence< TestInstance * > Sequence< uint >

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...
 

Detailed Description

Containers provide access to stored items.

Definition at line 35 of file Container.h.

Constructor & Destructor Documentation

◆ Container()

Container::Container ( )

Constructor.

Definition at line 20 of file Container.cpp.

◆ ~Container()

Container::~Container ( )
virtual

Destructor.

Definition at line 24 of file Container.cpp.

Member Function Documentation

◆ clear()

virtual void Container::clear ( )
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 * >.

◆ count()

virtual Size Container::count ( ) const
pure virtual

Returns the number of items inside the Container.

Returns
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().

◆ isEmpty()

bool Container::isEmpty ( ) const
virtual

Check if the Container is empty.

Returns
True if empty, false otherwise.

Reimplemented in List< T >.

Definition at line 28 of file Container.cpp.

References count().

◆ reserve()

bool Container::reserve ( Size  size)
virtual

Ensure that at least the given size is available.

Parameters
sizeSize to reserve in the Container
Returns
True if the given size is reserved, false otherwise.

Reimplemented in String.

Definition at line 33 of file Container.cpp.

References resize(), and size().

◆ resize()

bool Container::resize ( Size  size)
virtual

Change the size of the Container.

Parameters
sizeNew size of the container.
Returns
True if the resize succeeded, false otherwise.

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.

Referenced by reserve(), and shrink().

◆ shrink()

bool Container::shrink ( Size  size)
virtual

Shrink the container size by the given amount of items.

Parameters
sizeNumber of items to shrink.
Returns
True if shrink succeeded, false otherwise.

Definition at line 41 of file Container.cpp.

References resize(), and size().

◆ size()

virtual Size Container::size ( ) const
pure virtual

◆ squeeze()

Size Container::squeeze ( )
virtual

Try to minimize the memory required in the Container.

Returns
New size of the Container.

Definition at line 46 of file Container.cpp.

References size().


The documentation for this class was generated from the following files: