|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Interface for converting individuals to/from byte streams for network transport. More...
#include <Serializer.h>
Public Member Functions | |
| virtual | ~Serializer ()=default |
| virtual std::vector< std::uint8_t > | serialize (const std::vector< Individual< GeneType > > &individuals) const =0 |
| Serializes multiple individuals into a byte vector. | |
| virtual std::vector< std::uint8_t > | serialize (const Individual< GeneType > &individual) const =0 |
| Serializes a single individual. | |
| virtual std::vector< Individual< GeneType > > | deserialize (const std::vector< std::uint8_t > &individuals_serialized) const =0 |
| Deserializes a byte vector into individuals. | |
| virtual std::vector< Individual< GeneType > > | deserialize (const std::uint8_t *data, std::size_t size) const =0 |
| Deserializes from a raw pointer. | |
| virtual std::size_t | getSerializedSize (std::size_t individuals_count, std::size_t genes_count) const =0 |
| Calculates the exact size required to serialize a specific number of individuals. | |
Interface for converting individuals to/from byte streams for network transport.
Implementations define the binary wire format used during migration.
| GeneType | The gene type of the individuals. |
Definition at line 19 of file Serializer.h.
|
virtualdefault |
|
pure virtual |
Deserializes from a raw pointer.
| data | Pointer to the start of the data. |
| size | Number of bytes to read. |
Implemented in galib::internal::BinarySerializer< GeneType >.
|
pure virtual |
Deserializes a byte vector into individuals.
| individuals_serialized | The byte stream to read. |
Implemented in galib::internal::BinarySerializer< GeneType >.
Referenced by galib::internal::MpiCommunicator< GeneType >::allReduceBest(), and galib::internal::MpiCommunicator< GeneType >::update().
|
pure virtual |
Calculates the exact size required to serialize a specific number of individuals.
| individuals_count | Number of individuals. |
| genes_count | Number of genes per individual. |
Implemented in galib::internal::BinarySerializer< GeneType >.
|
pure virtual |
Serializes a single individual.
| individual | The individual to serialize. |
Implemented in galib::internal::BinarySerializer< GeneType >.
|
pure virtual |
Serializes multiple individuals into a byte vector.
| individuals | The individuals to serialize. |
Implemented in galib::internal::BinarySerializer< GeneType >.
Referenced by galib::internal::MpiCommunicator< GeneType >::allReduceBest(), galib::internal::MpiCommunicator< GeneType >::broadcast(), and galib::internal::MpiCommunicator< GeneType >::send().