Skip to content

Instantly share code, notes, and snippets.

@gayashanbc
Created July 22, 2018 18:36
Show Gist options
  • Save gayashanbc/307dab8b3a390b0191664bda82d0acf3 to your computer and use it in GitHub Desktop.
Save gayashanbc/307dab8b3a390b0191664bda82d0acf3 to your computer and use it in GitHub Desktop.
Header file of the Observer class (Observer Pattern in C++)
//
// Created by shan on 4/7/17.
//
#ifndef OBSERVER_PATTERN_OBSERVER_HPP
#define OBSERVER_PATTERN_OBSERVER_HPP
/**
* Interface for the Observer
*/
class Observer {
public:
/**
* Update the state of this observer
* @param temp new temperaure
* @param humidity new humidity
* @param pressure new pressure
*/
virtual void update(float temp, float humidity, float pressure) = 0;
};
#endif //OBSERVER_PATTERN_OBSERVER_HPP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment