C/C++
notifier.txt
Associated article: C++ Notifiers
Tags: C/C++
Published source code accompanying the article by Dave Pomerantz in which he discusses "notifiers" (also called "events" or "messages") which are used to pass information anonymously between objects. Dave shows notifiers can work in C++, using a multithreaded application as an example. Also see NOTIFIER.ZIP.
C++ Notifiers
by Dave Pomerantz
Listing One
class CTemperatureNotifier : public CNotifier
{
public:
CTemperatureNotifier(void) : CNotifier(TEMPERATURE_NOTIFIER)
{ m_temperature = 0.0; }
public:
float m_temperature; // temperature is in degrees celsius
};
// convenience function to send the notifier immediately
inline HRESULT SendTemperatureNotifier(float temperature)
{
...


