GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Public Member Functions | List of all members
galib::internal::CircularBuffer< GeneType > Class Template Reference

#include <CircularBuffer.h>

Inheritance diagram for galib::internal::CircularBuffer< GeneType >:
[legend]

Public Member Functions

 CircularBuffer (const std::size_t max_batches, const std::size_t batch_size)
 
void push (std::vector< Individual< GeneType > > &&incoming_deme_batch) override
 Adds a batch of individuals to the buffer.
 
virtual void popAll (std::vector< Individual< GeneType > > &target) override
 Retrieves and removes all currently stored migrants.
 
bool hasMigrants () const override
 Checks if there are any migrants waiting in the buffer.
 
- Public Member Functions inherited from galib::internal::MigrationBuffer< GeneType >
virtual ~MigrationBuffer ()=default
 

Detailed Description

template<typename GeneType>
class galib::internal::CircularBuffer< GeneType >

Definition at line 15 of file CircularBuffer.h.

Constructor & Destructor Documentation

◆ CircularBuffer()

template<typename GeneType >
galib::internal::CircularBuffer< GeneType >::CircularBuffer ( const std::size_t  max_batches,
const std::size_t  batch_size 
)
inlineexplicit

Definition at line 27 of file CircularBuffer.h.

Member Function Documentation

◆ hasMigrants()

template<typename GeneType >
bool galib::internal::CircularBuffer< GeneType >::hasMigrants ( ) const
inlineoverridevirtual

Checks if there are any migrants waiting in the buffer.

Returns
True if migrants are available, false otherwise.

Implements galib::internal::MigrationBuffer< GeneType >.

Definition at line 66 of file CircularBuffer.h.

◆ popAll()

template<typename GeneType >
virtual void galib::internal::CircularBuffer< GeneType >::popAll ( std::vector< Individual< GeneType > > &  target)
inlineoverridevirtual

Retrieves and removes all currently stored migrants.

Parameters
targetVector where the migrants will be moved to.

Implements galib::internal::MigrationBuffer< GeneType >.

Definition at line 43 of file CircularBuffer.h.

◆ push()

template<typename GeneType >
void galib::internal::CircularBuffer< GeneType >::push ( std::vector< Individual< GeneType > > &&  incoming_deme_batch)
inlineoverridevirtual

Adds a batch of individuals to the buffer.

Parameters
incoming_deme_batchThe individuals that arrived from another island.

Implements galib::internal::MigrationBuffer< GeneType >.

Definition at line 31 of file CircularBuffer.h.


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