Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
honey::Listener Class Reference

Holds a slot that can receive signals. More...

#include <Listener.h>

Inheritance diagram for honey::Listener:
Inheritance graph
[legend]
Collaboration diagram for honey::Listener:
Collaboration graph
[legend]

Public Types

typedef SharedPtr< ListenerPtr
 
typedef SharedPtr< const ListenerConstPtr
 
- Public Types inherited from honey::AllocatorObject< Alloc >
template<class T >
using Allocator = Alloc< T >
 

Public Member Functions

virtual ~Listener ()
 
SlotBaseslot () const
 Get slot. More...
 
const void * obj () const
 Get object instance for listener identification. More...
 
const Idid () const
 Get listener id. More...
 
- Public Member Functions inherited from honey::SharedObj< Listener >
 SharedObj (Alloc &&a=Alloc()) debug_if(
 Construct with allocator that is called to deallocate this shared object when all references have been released. More...
 
- Public Member Functions inherited from honey::AllocatorObject< Alloc >
void * operator new (szt size)
 
void * operator new (szt, void *ptr)
 
void * operator new (szt size, const char *srcFile, int srcLine)
 
void * operator new[] (szt size)
 
void * operator new[] (szt, void *ptr)
 
void * operator new[] (szt size, const char *srcFile, int srcLine)
 
void operator delete (void *p)
 
void operator delete[] (void *p)
 

Static Public Member Functions

template<class Signal , class F >
static Listenercreate (F &&f, const void *obj=nullptr, const Id &id=idnull)
 Construct with slot to receive Signal using function F. The object instance and id are used together to identify this listener. More...
 

Protected Member Functions

 Listener (SlotBase &slot, const void *obj, const Id &id)
 
- Protected Member Functions inherited from honey::SharedObj< Listener >
void finalize ()
 Destroys object. Called when strong reference count reaches 0. May be overridden to prevent destruction. More...
 

Protected Attributes

UniquePtr< SlotBase_slot
 
const void * _obj
 
Id _id
 

Detailed Description

Holds a slot that can receive signals.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual honey::Listener::~Listener ( )
inlinevirtual
honey::Listener::Listener ( SlotBase slot,
const void *  obj,
const Id id 
)
inlineprotected

Member Function Documentation

template<class Signal , class F >
static Listener& honey::Listener::create ( F &&  f,
const void *  obj = nullptr,
const Id id = idnull 
)
inlinestatic

Construct with slot to receive Signal using function F. The object instance and id are used together to identify this listener.

const Id& honey::Listener::id ( ) const
inline

Get listener id.

const void* honey::Listener::obj ( ) const
inline

Get object instance for listener identification.

SlotBase& honey::Listener::slot ( ) const
inline

Get slot.

Member Data Documentation

Id honey::Listener::_id
protected
const void* honey::Listener::_obj
protected
UniquePtr<SlotBase> honey::Listener::_slot
protected

The documentation for this class was generated from the following file: