mirror of https://github.com/deavmi/eventy.git
Added a few methods for Signal and Engine
This commit is contained in:
parent
635bdf255e
commit
29afd37f38
BIN
libeventdisp.a
BIN
libeventdisp.a
Binary file not shown.
|
@ -28,6 +28,19 @@ public final class Engine
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Event loop
|
||||
*/
|
||||
public void run()
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
/* TODO: Implement me */
|
||||
|
||||
/* TODO: Add yield to stop mutex starvation on a single thread */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* push(Event e)
|
||||
*
|
||||
|
|
|
@ -13,10 +13,40 @@ alias EventHandler = void function(Event);
|
|||
|
||||
public class Signal
|
||||
{
|
||||
/* TypeIDs this signal handler associates with */
|
||||
private ulong[] typeIDs;
|
||||
|
||||
/* Signal handler */
|
||||
private EventHandler handler;
|
||||
|
||||
this(ulong[] typeIDs, EventHandler handler)
|
||||
{
|
||||
this.typeIDs = typeIDs;
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this signal handles the given typeID
|
||||
* false otherwise
|
||||
*/
|
||||
public bool handles(ulong typeID)
|
||||
{
|
||||
/* FIXME: Implement */
|
||||
return true;
|
||||
}
|
||||
|
||||
public void registerTypeID(ulong typeID)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void deregisterTypeID(ulong typeID)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EventHandler getHandler()
|
||||
{
|
||||
return handler;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue