Chromosome::Representation::GaCodeValuesBuffer Class Reference

This class represents buffer for storing values of chromosome's code. It is also used for building chromosomes' codes. GaCodeValuesBuffer class also keeps track of current position for filling the buffer, but interpretation of it is left to users. More...

#include <D:/Temp/vs/gal/source/RepresentationInterfaces.h>

List of all members.

Public Member Functions

 GaCodeValuesBuffer (int size)
 This constructor allocates memory for buffer.
 ~GaCodeValuesBuffer ()
 The destructor frees memory used by the buffer.
void GACALL Move (int delta)
 Move method moves current position for filling the buffer.
void *GACALL GetBuffer () const
 This method is not thread safe.
int GACALL GetSize () const
 This method is not thread safe.
int GACALL GetPosition () const
 This method is not thread safe.

Private Attributes

void * _buffer
 Pointer to memory which is allocated for the buffer.
int _size
 Size in bytes of allocated memory.
int _currentPosition
 This attribute keeps track of current position for filling the buffer.


Detailed Description

This class represents buffer for storing values of chromosome's code. It is also used for building chromosomes' codes. GaCodeValuesBuffer class also keeps track of current position for filling the buffer, but interpretation of it is left to users.

This class has no built-in synchronizator, so LOCK_OBJECT and LOCK_THIS_OBJECT macros cannot be used with instances of this class. No public or private methods are thread-safe.


Constructor & Destructor Documentation

Chromosome::Representation::GaCodeValuesBuffer::GaCodeValuesBuffer ( int  size  )  [inline]

This constructor allocates memory for buffer.

Parameters:
size size of the buffer

Chromosome::Representation::GaCodeValuesBuffer::~GaCodeValuesBuffer (  )  [inline]

The destructor frees memory used by the buffer.


Member Function Documentation

void GACALL Chromosome::Representation::GaCodeValuesBuffer::Move ( int  delta  )  [inline]

Move method moves current position for filling the buffer.

This method is not thread-safe.

Parameters:
delta value by which the current position is moved. This parameter can be positive or negative.

void* GACALL Chromosome::Representation::GaCodeValuesBuffer::GetBuffer (  )  const [inline]

This method is not thread safe.

Returns:
Method returns pointer to memory used by the buffer.

int GACALL Chromosome::Representation::GaCodeValuesBuffer::GetSize (  )  const [inline]

This method is not thread safe.

Returns:
Method returns size of buffer's memory in bytes.

int GACALL Chromosome::Representation::GaCodeValuesBuffer::GetPosition (  )  const [inline]

This method is not thread safe.

Returns:
Method returns current position for filling the buffer.


Member Data Documentation

Pointer to memory which is allocated for the buffer.

Size in bytes of allocated memory.

This attribute keeps track of current position for filling the buffer.


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

Genetic Algorithm Library
Coolsoft Software Development