@Namespace(value="plasma") @NoOffset @Properties(inherit=plasma.class) public class EventLoop extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
EventLoop() |
EventLoop(long size)
Native array allocator.
|
EventLoop(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
AddFileEvent(int fd,
int events,
Pointer callback)
Add a new file event handler to the event loop.
|
long |
AddTimer(long timeout,
Pointer callback)
Register a handler that will be called after a time slice of
"timeout" milliseconds.
|
EventLoop |
getPointer(long i) |
EventLoop |
position(long position) |
void |
RemoveFileEvent(int fd)
Remove a file event handler from the event loop.
|
int |
RemoveTimer(long timer_id)
Remove a timer handler from the event loop.
|
void |
Shutdown() |
void |
Start()
\brief Run the event loop.
|
void |
Stop()
\brief Stop the event loop
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public EventLoop(Pointer p)
Pointer(Pointer)
.public EventLoop(long size)
Pointer.position(long)
.public EventLoop()
public EventLoop getPointer(long i)
getPointer
in class Pointer
@Cast(value="bool") public boolean AddFileEvent(int fd, int events, @Cast(value="const plasma::EventLoop::FileCallback*") @ByRef Pointer callback)
fd
- The file descriptor we are listening to.events
- The flags for events we are listening to (read or write).callback
- The callback that will be called when the event happens.public void RemoveFileEvent(int fd)
fd
- The file descriptor of the event handler.@Cast(value="int64_t") public long AddTimer(@Cast(value="int64_t") long timeout, @Cast(value="const plasma::EventLoop::TimerCallback*") @ByRef Pointer callback)
timeout
- The timeout in milliseconds.callback
- The callback for the timeout.public int RemoveTimer(@Cast(value="int64_t") long timer_id)
timer_id
- The ID of the timer that is to be removed.public void Start()
public void Stop()
public void Shutdown()
Copyright © 2022. All rights reserved.