#ifndef __Observer__
#define __Observer__

#ifndef CORE_DLL 
    #ifdef CORE_BUILD
	    #define CORE_DLL __declspec(dllexport)
    #else
	    #define CORE_DLL __declspec(dllimport)
        #pragma comment(lib, "Core.lib")
    #endif
#endif

#pragma warning(push)
#pragma warning(disable:4251)

#include <list>


class CORE_DLL Observer;
class CORE_DLL Observable;


/*****************************************************
*	Observable base class
*****************************************************/

class CORE_DLL Observable {
public:
	virtual void attach(Observer* observer);
	virtual void detach(Observer* observer);

	virtual void notify();

protected:
    std::list<Observer*> _observers;
};





/*****************************************************
*	Observer base class
*****************************************************/

class CORE_DLL Observer {
public:
	virtual void attach(Observable* observable);
	virtual void detach(Observable* observable);

	virtual void notify(Observable* observable) = 0;
};

#pragma warning(pop)

#endif