Skip to content

Instantly share code, notes, and snippets.

@gayashanbc
Created July 22, 2018 18:41
Show Gist options
  • Save gayashanbc/2a517748f932c385224c4579e50ff782 to your computer and use it in GitHub Desktop.
Save gayashanbc/2a517748f932c385224c4579e50ff782 to your computer and use it in GitHub Desktop.
Header file of the Client class (Observer Pattern in C++)
//
// Created by shan on 4/7/17.
//
#ifndef OBSERVER_PATTERN_CLIENT_1_HPP
#define OBSERVER_PATTERN_CLIENT_1_HPP
#include <iostream>
#include "Observer.hpp"
/**
* a client that implements the Observer interface
*/
class Client : public Observer {
int id;
public:
Client(int id);
virtual void update(float temp, float humidity, float pressure) override;
};
#endif //OBSERVER_PATTERN_CLIENT_1_HPP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment