Index

SIniFileFactory Class Reference

Factory class for the SIniFile non-terminal. More...

#include "ini__SIniFile.h"


Inherited Class(es)


Public Functions

Private Variables

Private Static Variables


Detailed Description

Factory class for the SIniFile non-terminal.

The factory provides a 1 spare object optimisation to avoid useless and time-consuming object instantiations and destructions.

That means that the first time a symbol instance needs to be created and to be parsed, the symbol is actually created using the 'new' operator. If afterwards the parsing fails, the instance is not destroyed by the factory and is kept as a spare object that will be returned at the next creation request. Otherwise, if the parsing was successful, another object is created which may become in turn a spare object on a parse failure.


Functions Documentation

SIniFileFactory ( ) 

Constructor. Constructs a default spare object.

See also:

Back to index

~SIniFileFactory ( )   [  virtual  ] 

Destructor.

See also:

Back to index

SIniFile * create ( )   [  virtual  ] 

Creates an instance of the symbol. If there is a spare object available, it returns it. Otherwise a new object is created and returned.

See also:

virtual void destroy SIniFile * & pInstance 
Back to index

void destroy SIniFile * & pInstance   [  virtual  ] 

Destroys the instance of the symbol from the passed pointer pInstance. However, if the factory has no spare object currently in reserve, the object is not destroyed but kept as spare object that will be returned at the next creation request.

In all cases, the pointer pInstance is set to null.

See also:

virtual SIniFile * create ( ) 
Back to index

unsigned long getNbCreated ( ) const 

Returns the number of instance created in all. It is NOT the number of times the create() method was called, but actually the real number of times that an instance had to be created with the 'new' operator.

See also:

virtual SIniFile * create ( ) 
Back to index


Generated with makedoc.