telldus/telldus-core/client/CallbackMainDispatcher.h
Micke Prag f7336b34f9 Rewrite our callback dispatcher. Instead of dynamically create new
threads for each callback they are now precreated when they are
registered. Each callback will now be called using the same thread each
time.
2014-01-08 13:55:02 +01:00

35 lines
769 B
C++

/*
* CallbackMainDispatcher.h
* telldus-core
*
* Created by Stefan Persson on 2012-02-23.
* Copyright 2012 Telldus Technologies AB. All rights reserved.
*
*/
#ifndef CALLBACKMAINDISPATCHER_H
#define CALLBACKMAINDISPATCHER_H
#include "client/CallbackDispatcher.h"
#include "common/Thread.h"
namespace TelldusCore {
class CallbackMainDispatcher
{
public:
CallbackMainDispatcher(void);
~CallbackMainDispatcher(void);
void execute(TelldusCore::CallbackStruct::CallbackType type, EventData *eventData);
int registerCallback( TelldusCore::CallbackStruct::CallbackType type, void *eventFunction, void *context );
int unregisterCallback( int callbackId );
private:
class PrivateData;
PrivateData *d;
};
}
#endif //CALLBACKMAINDISPATCHER_H