binstream.hpp

См. документацию.
00001 /*
00002 
00003 Copyright (c) 2002-2005, Yauheni Akhotnikau
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008 
00009 - Redistributions of source code must retain the above copyright notice, this
00010 list of conditions and the following disclaimer.
00011 
00012 - Redistributions in binary form must reproduce the above copyright notice, this
00013 list of conditions and the following disclaimer in the documentation and/or
00014 other materials provided with the distribution.
00015 
00016 - The name of the author may not be used to endorse or promote products derived
00017 from this software without specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00020 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00021 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00022 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00024 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00027 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00028 OF SUCH DAMAGE.
00029 
00030 */
00031 
00038 #if !defined( _OESS_1__IO__BIN_STREAM_HPP_ )
00039 #define _OESS_1__IO__BIN_STREAM_HPP_
00040 
00041 #include <oess_1/io/h/declspec.hpp>
00042 
00043 #include <oess_1/io/h/stream.hpp>
00044 
00045 namespace oess_1 {
00046 
00047 namespace io {
00048 
00049 //
00050 // ibinstream_t
00051 //
00052 
00059 class OESS_1__IO__TYPE  ibinstream_t :
00060   public istream_t {
00061   public :
00062     virtual ~ibinstream_t();
00063 
00064     virtual void
00065     read( oess_1::char_t * p, size_t count );
00066 
00067     virtual void
00068     read( oess_1::schar_t * p, size_t count );
00069 
00070     virtual void
00071     read( oess_1::uchar_t * p, size_t count );
00072 
00073     virtual void
00074     read( oess_1::short_t * p, size_t count );
00075 
00076     virtual void
00077     read( oess_1::ushort_t * p, size_t count );
00078 
00079     virtual void
00080     read( oess_1::int_t * p, size_t count );
00081 
00082     virtual void
00083     read( oess_1::uint_t * p, size_t count );
00084 
00085     virtual void
00086     read( oess_1::single_t * p, size_t count );
00087 
00088     virtual void
00089     read( oess_1::double_t * p, size_t count );
00090 
00091     virtual void
00092     read( std::string & p );
00093 
00094     virtual void
00095     read( oess_1::defs::quantity_t & p );
00096 
00097     virtual bool
00098     eof() const = 0;
00099 
00100   protected :
00101     friend  class ibuffer_accessor_t;
00102     friend  class isubbinstream_t;
00103 
00106 
00111     virtual const oess_1::char_t *
00112     in_reserve(
00115       size_t item_count,
00117       size_t item_size,
00120       size_t & item_available ) = 0;
00121 
00123 
00128     virtual void
00129     in_shift(
00131       size_t item_count,
00133       size_t item_size ) = 0;
00134 };
00135 
00136 //
00137 // obinstream_t
00138 //
00139 
00146 class OESS_1__IO__TYPE  obinstream_t :
00147   public ostream_t {
00148   public :
00149     virtual ~obinstream_t();
00150 
00151     virtual void
00152     write( const oess_1::char_t * p, size_t count );
00153 
00154     virtual void
00155     write( const oess_1::schar_t * p, size_t count );
00156 
00157     virtual void
00158     write( const oess_1::uchar_t * p, size_t count );
00159 
00160     virtual void
00161     write( const oess_1::short_t * p, size_t count );
00162 
00163     virtual void
00164     write( const oess_1::ushort_t * p, size_t count );
00165 
00166     virtual void
00167     write( const oess_1::int_t * p, size_t count );
00168 
00169     virtual void
00170     write( const oess_1::uint_t * p, size_t count );
00171 
00172     virtual void
00173     write( const oess_1::single_t * p, size_t count );
00174 
00175     virtual void
00176     write( const oess_1::double_t * p, size_t count );
00177 
00178     virtual void
00179     write( const std::string & p );
00180 
00181     virtual void
00182     write( const oess_1::defs::quantity_t & p );
00183 
00184   protected :
00185     friend  class obuffer_accessor_t;
00186 
00189 
00194     virtual oess_1::char_t *
00195     out_reserve(
00198       size_t item_count,
00200       size_t item_size,
00203       size_t & item_available ) = 0;
00204 
00206 
00211     virtual void
00212     out_shift(
00214       size_t item_count,
00216       size_t item_size ) = 0;
00217 };
00218 
00219 } /* namespace io */
00220 
00221 } /* namespace oess_1 */
00222 
00223 #endif
00224 

Документация по ObjESSty. Последние изменения: Fri Oct 13 18:35:36 2006. Создано системой  doxygen 1.4.7
Hosted by uCoz