IOClient.h

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2004-2006 Intel Corporation
00003  * 
00004  *    Licensed under the Apache License, Version 2.0 (the "License");
00005  *    you may not use this file except in compliance with the License.
00006  *    You may obtain a copy of the License at
00007  * 
00008  *        http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  *    Unless required by applicable law or agreed to in writing, software
00011  *    distributed under the License is distributed on an "AS IS" BASIS,
00012  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *    See the License for the specific language governing permissions and
00014  *    limitations under the License.
00015  */
00016 
00017 
00018 #ifndef _OASYS_IOCLIENT_H_
00019 #define _OASYS_IOCLIENT_H_
00020 
00021 #include <sys/types.h>
00022 #include <sys/uio.h>
00023 
00024 #include "IO.h"
00025 
00026 namespace oasys {
00027 
00031 class IOClient : virtual public IOHandlerBase {
00032 public:
00033     virtual ~IOClient() {}
00034 
00036 
00039     virtual int read(char* bp, size_t len)                  = 0;
00040     virtual int write(const char* bp, size_t len)           = 0;
00041     virtual int readv(const struct iovec* iov, int iovcnt)  = 0;
00042     virtual int writev(const struct iovec* iov, int iovcnt) = 0;
00044     
00046 
00052     virtual int readall(char* bp, size_t len)                  = 0;
00053     virtual int writeall(const char* bp, size_t len)           = 0;
00054     virtual int readvall(const struct iovec* iov, int iovcnt)  = 0;
00055     virtual int writevall(const struct iovec* iov, int iovcnt) = 0;
00057 
00059 
00066     virtual int timeout_read(char* bp, size_t len, int timeout_ms) = 0;
00067     virtual int timeout_readv(const struct iovec* iov, int iovcnt,
00068                               int timeout_ms) = 0;
00069     virtual int timeout_readall(char* bp, size_t len, int timeout_ms) = 0;
00070     virtual int timeout_readvall(const struct iovec* iov, int iovcnt,
00071                                  int timeout_ms) = 0;
00072     virtual int timeout_write(const char* bp, size_t len, int timeout_ms) = 0;
00073     virtual int timeout_writev(const struct iovec* iov, int iovcnt,
00074                                int timeout_ms) = 0;
00075     virtual int timeout_writeall(const char* bp, size_t len, int timeout_ms) = 0;
00076     virtual int timeout_writevall(const struct iovec* iov, int iovcnt,
00077                                   int timeout_ms) = 0;
00079 
00081     virtual int get_nonblocking(bool* nonblockingp) = 0;
00082     virtual int set_nonblocking(bool nonblocking)   = 0;
00083 };
00084 
00085 } // namespace oasys
00086 
00087 #endif // _OASYS_IOCLIENT_H_

Generated on Sat Sep 8 08:43:29 2007 for DTN Reference Implementation by  doxygen 1.5.3