Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Parse::NaturalVectorParser Class Template Reference

#include <ListParser.h>

Inheritance diagram for Parse::NaturalVectorParser:

Inheritance graph
[legend]
Collaboration diagram for Parse::NaturalVectorParser:

Collaboration graph
[legend]
List of all members.

Public Methods

 NaturalVectorParser (vector< Base *> &vectorToAddTo)
virtual void getValue (istream &input)

Detailed Description

template<class Base, class Derived = Base>
class Parse::NaturalVectorParser< Base, Derived >

ParseAction used for adding a newly allocated Derived into a std::vector<Base*>. Note that Base must be a subclass of Parseable.

Definition at line 181 of file ListParser.h.


Constructor & Destructor Documentation

template<class Base, class Derived = Base>
Parse::NaturalVectorParser< Base, Derived >::NaturalVectorParser vector< Base *> &    vectorToAddTo
 

NaturalVectorParser constructor

Parameters:
vectorToAddTo  vector of pointers to Parseable that serves as a place to store references to dynamically allocated Derived

Definition at line 187 of file ListParser.h.


Member Function Documentation

template<class Base, class Derived = Base>
virtual void Parse::NaturalVectorParser< Base, Derived >::getValue istream &    input [virtual]
 

Allocates a new Derived, parses istream input for values, and then places the newly allocated in the vector passed to the constructor. The Derived will be at the back of the vector, unless the identifier "index" was read, in which case it will be placed at index. It will NOT delete the pointer at the old index, causing it to overwrite and could lead to memory leaks. If an index was read that is >= the previous vector size, it will be resized so the index can fit into the vector. New added elements will be NULL.

Reimplemented from Parse::ParseAction.

Definition at line 197 of file ListParser.h.


The documentation for this class was generated from the following file:
Generated on Tue May 21 07:26:57 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001