SOL9 2.0 Class: HandlerEntry

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * HandlerEntry.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL++2000
#pragma once

#include <sol\Entry.h>
#include <sol\Event.h>


typedef long (Object::*Handler)(Event&);

namespace SOL {

class HandlerEntry :public Entry {
private:
    UINT          message;
    Handler       handler;
    HandlerEntry* next;

public:
    HandlerEntry(UINT msg, Object* object, Handler proc, void* data) 
    :Entry(object, data),
        message(msg),
        handler(proc),
        next(NULL)
    {
    }

public:
    long    call(Event& event)
    {
        Object* object = getObject();
        event.setData(getData());
        return (object->*handler)(event);
    }

    void    add(HandlerEntry* entry) { next = entry; }

    UINT    getMessage() { return message; }
    HandlerEntry* getNext() { return next; }
};

}


Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.