Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gwu479/Summa-Actors
  • numerical_simulations_lab/actors/Summa-Actors
2 results
Show changes
Showing
with 2188 additions and 2122 deletions
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include "caf/all.hpp"
#include "client.hpp"
Client::Client(int id, caf::actor client_actor, std::string hostname) {
this->id = id;
this->client_actor = client_actor;
this->hostname = hostname;
this->connected = true;
this->current_batch = {};
}
// ####################################################################
// Getters
// ####################################################################
caf::actor Client::getActor() {
return this->client_actor;
}
......@@ -20,4 +20,27 @@ int Client::getID() {
std::string Client::getHostname() {
return this->hostname;
}
std::optional<Batch> Client::getBatch() {
return this->current_batch;
}
// ####################################################################
// Setters
// ####################################################################
void Client::setBatch(std::optional<Batch> batch) {
this->current_batch = batch;
}
// ####################################################################
// Methods
// ####################################################################
std::string Client::toString() {
std::stringstream out_string;
out_string << "hostname: " << this->hostname << "\n" <<
"id: " << this->id << "\n" <<
"batches_solved: " << this->batches_solved << "\n";
return out_string.str();
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.