KernelStreams.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005 Palmsource, Inc.
00003  * 
00004  * This software is licensed as described in the file LICENSE, which
00005  * you should have received as part of this distribution. The terms
00006  * are also available at http://www.openbinder.org/license.html.
00007  * 
00008  * This software consists of voluntary contributions made by many
00009  * individuals. For the exact contribution history, see the revision
00010  * history and logs, available at http://www.openbinder.org
00011  */
00012 
00013 #ifndef _SUPPORT_KERNELSTREAMS_H
00014 #define _SUPPORT_KERNELSTREAMS_H
00015 
00021 #include <support/SupportDefs.h>
00022 #include <support/ByteStream.h>
00023 #include <sys/uio.h>
00024 
00025 #if _SUPPORTS_NAMESPACE
00026 namespace palmos {
00027 namespace support {
00028 #endif
00029 
00034 /*---------------------------------------------------------------------*/
00035 
00036 class BKernelOStr : public BnByteOutput
00037 {
00038     public:
00039                                 BKernelOStr(int32_t descriptor);
00040         virtual                 ~BKernelOStr();
00041         
00042         virtual ssize_t         WriteV(const struct iovec *vector, ssize_t count, uint32_t flags = 0);
00043         virtual status_t        Sync();
00044 
00045     private:
00046 
00047                 int32_t         m_descriptor;
00048 };
00049 
00050 /*-------------------------------------------------------------*/
00051 
00052 class BKernelIStr : public BnByteInput
00053 {
00054     public:
00055                                 BKernelIStr(int32_t descriptor);
00056         virtual                 ~BKernelIStr();
00057         
00058         virtual ssize_t         ReadV(const struct iovec *vector, ssize_t count, uint32_t flags = 0);
00059 
00060     private:
00061 
00062                 int32_t         m_descriptor;
00063 };
00064 
00065 /*-------------------------------------------------------------*/
00066 
00069 #if _SUPPORTS_NAMESPACE
00070 } } // namespace palmos::support
00071 #endif
00072 
00073 #endif /* _SUPPORT_KERNELSTREAMS_H */