Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _UNIX_COMPLETION_UTIL_H_
00025 #define _UNIX_COMPLETION_UTIL_H_
00026
00027
00028
00029 #include "UDPIOEvent.h"
00030
00031 inline Event *
00032 completionUtil::create()
00033 {
00034 UDPIOEvent *u = UDPIOEventAllocator.alloc();
00035 return u;
00036 };
00037 inline void
00038 completionUtil::destroy(Event * e)
00039 {
00040 ink_assert(e != NULL);
00041 UDPIOEvent *u = (UDPIOEvent *) e;
00042 UDPIOEvent::free(u);
00043 };
00044 inline void
00045 completionUtil::setThread(Event * e, EThread * t)
00046 {
00047 UDPIOEvent *u = (UDPIOEvent *) e;
00048 u->ethread = t;
00049 }
00050 inline void
00051 completionUtil::setContinuation(Event * e, Continuation * c)
00052 {
00053 UDPIOEvent *u = (UDPIOEvent *) e;
00054 *(Action *) u = c;
00055 }
00056 inline void *
00057 completionUtil::getHandle(Event * e)
00058 {
00059 UDPIOEvent *u = (UDPIOEvent *) e;
00060 return u->getHandle();
00061 }
00062 inline void
00063 completionUtil::setHandle(Event * e, void *handle)
00064 {
00065 UDPIOEvent *u = (UDPIOEvent *) e;
00066 u->setHandle(handle);
00067 }
00068 inline void
00069 completionUtil::setInfo(Event * e, int fd, IOBufferBlock * buf, int actual, int errno_)
00070 {
00071 UDPIOEvent *u = (UDPIOEvent *) e;
00072 u->setInfo(fd, buf, actual, errno_);
00073 }
00074 inline void
00075 completionUtil::setInfo(Event * e, int fd, struct msghdr *msg, int actual, int errno_)
00076 {
00077 UDPIOEvent *u = (UDPIOEvent *) e;
00078 u->setInfo(fd, msg, actual, errno_);
00079 }
00080 inline int
00081 completionUtil::getBytesTransferred(Event * e)
00082 {
00083 UDPIOEvent *u = (UDPIOEvent *) e;
00084 return u->getBytesTransferred();
00085 }
00086 inline IOBufferBlock *
00087 completionUtil::getIOBufferBlock(Event * e)
00088 {
00089 UDPIOEvent *u = (UDPIOEvent *) e;
00090 return u->getIOBufferBlock();
00091 }
00092 inline Continuation *
00093 completionUtil::getContinuation(Event * e)
00094 {
00095 UDPIOEvent *u = (UDPIOEvent *) e;
00096 return u->getContinuation();
00097 }
00098 inline int
00099 completionUtil::getError(Event * e)
00100 {
00101 UDPIOEvent *u = (UDPIOEvent *) e;
00102 return u->getError();
00103 }
00104 #endif