• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

UnixCompletionUtil.h

Go to the documentation of this file.
00001 /** @file
00002 
00003   A brief file description
00004 
00005   @section license License
00006 
00007   Licensed to the Apache Software Foundation (ASF) under one
00008   or more contributor license agreements.  See the NOTICE file
00009   distributed with this work for additional information
00010   regarding copyright ownership.  The ASF licenses this file
00011   to you under the Apache License, Version 2.0 (the
00012   "License"); you may not use this file except in compliance
00013   with the License.  You may obtain a copy of the License at
00014 
00015       http://www.apache.org/licenses/LICENSE-2.0
00016 
00017   Unless required by applicable law or agreed to in writing, software
00018   distributed under the License is distributed on an "AS IS" BASIS,
00019   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020   See the License for the specific language governing permissions and
00021   limitations under the License.
00022  */
00023 
00024 #ifndef _UNIX_COMPLETION_UTIL_H_
00025 #define _UNIX_COMPLETION_UTIL_H_
00026 
00027 // platform specific wrappers for dealing with I/O completion events
00028 // passed into and back from the I/O core.
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

Generated by  doxygen 1.7.1