Classes | Namespaces | Defines

_src_base_event.hh File Reference

C++ template to call every registered listener function. More...

#include "base/globals.hh"

Go to the source code of this file.

Classes

class  base::Event< EVENT >
 Broadcasts events to registered listener functors. More...
class  base::Event< EVENT >::ListenerFunctor
 Listener functor called when event is broadcast. More...

Namespaces

namespace  base
 

Library of base code.


Defines

#define CLASS_EVENT_LISTENER(LISTENER_CLASS, EVENT_CLASS, OWNER_CLASS, OWNER_MEMBER)
#define CLASS_EVENT_LISTENER_BASIC(LISTENER_CLASS, EVENT_CLASS)

Detailed Description

C++ template to call every registered listener function.

LastChangedDate:
2011-04-23 21:07:07 -0400 (Sat, 23 Apr 2011)
Author:
Jim E. Brooks http://www.palomino3d.org

Define Documentation

#define CLASS_EVENT_LISTENER (   LISTENER_CLASS,
  EVENT_CLASS,
  OWNER_CLASS,
  OWNER_MEMBER 
)
Value:
class LISTENER_CLASS : public base::Event<EVENT_CLASS>::ListenerFunctor                 \
{                                                                                       \
public:                                                                                 \
             LISTENER_CLASS( OWNER_CLASS& obj ) : OWNER_MEMBER(obj) { }                 \
    virtual ~LISTENER_CLASS() { }                                                       \
    virtual void operator()( EVENT_CLASS );                                             \
                          /* EVENT_CLASS& faster but wrong if class is shptr<> */       \
private:                  /* shptr<> must never be passed as a reference */             \
    OWNER_CLASS& OWNER_MEMBER;                                                          \
};
#define CLASS_EVENT_LISTENER_BASIC (   LISTENER_CLASS,
  EVENT_CLASS 
)
Value:
class LISTENER_CLASS : public base::Event<EVENT_CLASS>::ListenerFunctor                 \
{                                                                                       \
public:                                                                                 \
             LISTENER_CLASS( void ) { }                                                 \
    virtual ~LISTENER_CLASS() { }                                                       \
    virtual void operator()( EVENT_CLASS  );                                            \
};
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Palomino Flight Simulator documents generated by doxygen 1.7.1 on Tue May 15 2012 22:40:10