Main Page | Modules | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SLDirectoryList Class Reference
[segusoland C++ Library]

Holds a list of SLDirectory instances. More...

#include <SLDirectoryList.hpp>

Collaboration diagram for SLDirectoryList:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 SLDirectoryList (unsigned int initial_capacity)
const SLDirectoryoperator[] (unsigned int index) const
void push_back (const SLDirectory &file)
unsigned int size () const
void sort ()

Protected Attributes

boost::shared_ptr< Data > _shared_ptr
bool _isSorted

Detailed Description

Holds a list of SLDirectory instances.

Author:
Alexandre Sauve
See also:
SLDirectory

SLFileList

SLString uses shared_ptr, see the Library section for details.

This class is optimized for fast copy by value.


Constructor & Destructor Documentation

SLDirectoryList::SLDirectoryList unsigned int  initial_capacity  ) 
 

Build the list with an initial capacity. The initial_capacity allow to avoid frequent reallocations.


Member Function Documentation

const SLDirectory& SLDirectoryList::operator[] unsigned int  index  )  const
 

The [] operator allow to read the list as it was an array.

Returns:
a SLFile that is leak-proof.

void SLDirectoryList::push_back const SLDirectory file  ) 
 

This function works like std::vector. There is no memory allocation while the size of the list remains bellow the initial capacity.

unsigned int SLDirectoryList::size  )  const
 

Gets the size of the list.

Returns:
the current number of inserted items.

void SLDirectoryList::sort  ) 
 

The list is unsorted by default. So this function does this work.

Note: If called more than once, the sort done only one time.


Member Data Documentation

bool SLDirectoryList::_isSorted [protected]
 

This variables is true after the 1st call to sort()

boost::shared_ptr<Data> SLDirectoryList::_shared_ptr [protected]
 

This variable hold the various data used by the string in an efficient and memory leaks proof way.


The documentation for this class was generated from the following file:
Generated on Mon Apr 19 01:03:35 2004 for segusoLand by doxygen 1.3.6-20040222