Skip to content

Instantly share code, notes, and snippets.

@gayashanbc
Created July 22, 2018 18:43
Show Gist options
  • Save gayashanbc/8110f3a2845daeccd0fec64349ab508c to your computer and use it in GitHub Desktop.
Save gayashanbc/8110f3a2845daeccd0fec64349ab508c to your computer and use it in GitHub Desktop.
Implementation file of the Client class (Observer Pattern in C++)
//
// Created by shan on 4/7/17.
//
#include "Client.hpp"
void Client::update(float temp, float humidity, float pressure) {
// print the changed values
std::cout << "---Client (" << id << ") Data---\tTemperature: " << temp
<< "\tHumidity: " << humidity
<< "\tPressure: " << pressure
<< std::endl;
}
Client::Client(int id) {
this->id = id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment