BWAPI
Classes | Defines
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/Kinetic/Listener.h File Reference
#include <CGAL/Kinetic/basic.h>
#include <boost/utility.hpp>
Include dependency graph for Listener.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Listener_base< Interface >
 This is the base class for all listener objects. More...
class  Listener_base< Interface >::Handle

Defines

#define CGAL_KINETIC_LISTENER1(A)
#define CGAL_KINETIC_LISTENERNT1(A)
#define CGAL_KINETIC_LISTENER2(A, B)
#define CGAL_KINETIC_LISTENERNT2(A, B)
#define CGAL_KINETIC_NOTIFY(field)   if (listener_!= NULL) listener_->new_notification(Listener::field)
#define CGAL_KINETIC_LISTENER_DESTRUCTOR   CGAL_assertion(listener_==NULL);
#define CGAL_KINETIC_LISTENER_BASICS(Name, KDS)
#define CGAL_KINETIC_LISTEN1(Notifier, NOTIF, function)
#define CGAL_KINETIC_LISTEN2(Notifier, NOTIF, function, NOTIF2, function2)
#define CGAL_KINETIC_NOTIFIER(Notifier)   listener_##Notifier##_.notifier()
#define CGAL_KINETIC_INIT_LISTEN(Notifier, ptr)

Define Documentation

#define CGAL_KINETIC_INIT_LISTEN (   Notifier,
  ptr 
)
Value:
listener_##Notifier##_.set_recipient(this);     \
  listener_##Notifier##_.set_notifier(ptr);
#define CGAL_KINETIC_LISTEN1 (   Notifier,
  NOTIF,
  function 
)
Value:
private:                                                                \
  class Notifier##_listener: public Notifier::Listener {                \
    CGAL_KINETIC_LISTENER_BASICS(Notifier##_listener, This);            \
  public:                                                               \
    virtual void new_notification(typename Notifier::Listener::Notification_type t) { \
      if (recipient() != NULL && t== Notifier::Listener::NOTIF) recipient()->function; \
      else {                                                            \
      }                                                                 \
    }                                                                   \
  };                                                            \
  friend class Notifier##_listener;                                     \
  Notifier##_listener listener_##Notifier##_;
#define CGAL_KINETIC_LISTEN2 (   Notifier,
  NOTIF,
  function,
  NOTIF2,
  function2 
)
Value:
private:                                                                \
  class Notifier##_listener: public Notifier::Listener {                \
    CGAL_KINETIC_LISTENER_BASICS(Notifier##_listener, This);            \
  public:                                                               \
    virtual void new_notification(typename Notifier::Listener::Notification_type t) { \
      if (recipient()== NULL) return;                                   \
      if (t== Notifier::Listener::NOTIF)        recipient()->function();        \
      else if (t== Notifier::Listener::NOTIF2)  recipient()->function2; \
      else {                                                            \
      }                                                                 \
    }                                                                   \
  };                                                            \
  friend class Notifier##_listener;                                     \
  Notifier##_listener listener_##Notifier##_;
#define CGAL_KINETIC_LISTENER1 (   A)
Value:
private:                        \
  struct Listener_core{                                         \
    typedef This Notifier;                                      \
    typedef enum {A} Notification_type;                         \
  };                                                            \
  public:                                                       \
  typedef CGAL::Kinetic::Listener_base<Listener_core> Listener; \
  friend class CGAL::Kinetic::Listener_base<Listener_core>;     \
private:                                                        \
  void set_listener(Listener *sk) {                             \
    listener_=sk;                                               \
  }                                                             \
  Listener* listener() {return listener_.get();}                \
  typename Listener::Handle listener_;
#define CGAL_KINETIC_LISTENER2 (   A,
 
)
Value:
private:                        \
  struct Listener_core{                                         \
    typedef This Notifier;                                      \
    typedef enum {A,B} Notification_type;                       \
  };                                                            \
  public:                                                       \
  typedef CGAL::Kinetic::Listener_base<Listener_core> Listener; \
  friend class CGAL::Kinetic::Listener_base<Listener_core>;     \
private:                                                        \
  void set_listener(Listener *sk) {                             \
    listener_=sk;                                               \
  }                                                             \
  Listener* listener() {return listener_.get();}                \
  typename Listener::Handle listener_;
#define CGAL_KINETIC_LISTENER_BASICS (   Name,
  KDS 
)
Value:
public:                                         \
  Name(): recipient_(NULL){}                            \
  typedef KDS Recipient;                                \
  Recipient* recipient() const {return recipient_;}     \
  void set_recipient(Recipient *r){recipient_=r;}       \
private:                                                \
 Recipient* recipient_;
#define CGAL_KINETIC_LISTENER_DESTRUCTOR   CGAL_assertion(listener_==NULL);
#define CGAL_KINETIC_LISTENERNT1 (   A)
Value:
private:                        \
  struct Listener_core{                                         \
    typedef This Notifier;                                      \
    typedef enum {A} Notification_type;                         \
  };                                                            \
public:                                                         \
 typedef CGAL::Kinetic::Listener_base<Listener_core> Listener;  \
 friend class CGAL::Kinetic::Listener_base<Listener_core>;      \
private:                                                        \
 void set_listener(Listener *sk) {                              \
   listener_=sk;                                                \
 }                                                              \
 Listener* listener() {return listener_.get();}                 \
 Listener::Handle listener_;
#define CGAL_KINETIC_LISTENERNT2 (   A,
 
)
Value:
private:                        \
  struct Listener_core{                                         \
    typedef This Notifier;                                      \
    typedef enum {A,B} Notification_type;                       \
  };                                                            \
public:                                                         \
 typedef CGAL::Kinetic::Listener_base<Listener_core> Listener;  \
 friend class CGAL::Kinetic::Listener_base<Listener_core>;      \
private:                                                        \
 void set_listener(Listener *sk) {                              \
   listener_=sk;                                                \
 }                                                              \
 Listener* listener() {return listener_.get();}                 \
 Listener::Handle listener_;
#define CGAL_KINETIC_NOTIFIER (   Notifier)    listener_##Notifier##_.notifier()
#define CGAL_KINETIC_NOTIFY (   field)    if (listener_!= NULL) listener_->new_notification(Listener::field)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines