FdObjEpollData

Struct binding fd and a Object.

Members

Functions

verifyFd
bool verifyFd(int fd)

Compares the appropriate byte of the given fd with the instance of this struct.

Static functions

decode
FdObjEpollData decode(ulong registration)

Parses the registration to extract the Object and the fd part from it. Reverses the process of encode

encode
ulong encode(Object obj, int fd)

Encodes the Object's address and the fd's least significant byte into a ulong, suitable to register with epoll.

Variables

obj
Object obj;

Object instance

Examples

auto client = new Object;
int fd = 100;
auto r = FdObjEpollData.decode(FdObjEpollData.encode(client, fd));

test!("is")(client, r.obj);
test!("==")(r.verifyFd(fd), true);

Meta