Subject.h File Reference

#include "TypeAwareObject.h"
#include <string>

Go to the source code of this file.

Classes

class  Subject
 Base class for objects to send notification when their data changes. More...

Defines

#define SIGNAL_METHOD(type, name)
#define SIGNAL_NAME(type, name)   type::signal##name()


Define Documentation

#define SIGNAL_METHOD ( type,
name   ) 

Value:

static const std::string &signal##name() \
   { \
      static std::string signalName(#type "::" #name);  \
      return signalName;\
   }
This macro simplifies and standardizes creation of signal methods.

This macro will create a static method to use when attaching, detaching and notifying. The full body of the method is created. For example:

  SIGNAL_METHOD(MyClass, MySignal)
will create the following method:
  static const std::string &signalMySignal() { ... }

Parameters:
type The class that the signal is emitted by
name The unique name for the signal.

Definition at line 37 of file Subject.h.

#define SIGNAL_NAME ( type,
name   )     type::signal##name()

This macro simplifies specifying a particular signal.

For example:

  notify(SIGNAL_NAME(MyClass, MySignal));
notifies with the signal created with
  SIGNAL_METHOD(MyClass, MySignal)

Parameters:
type The class that the signal is emitted by
name The unique name for the signal.

Definition at line 59 of file Subject.h.


Software Development Kit - Opticks 4.9.0 Build 16218