stream.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 
00037 #if !defined( _OESS_1__IO__STREAM_HPP_ )
00038 #define _OESS_1__IO__STREAM_HPP_
00039 
00040 #include <oess_1/io/h/declspec.hpp>
00041 
00042 #include <string>
00043 
00044 #include <oess_1/defs/h/types.hpp>
00045 #include <oess_1/defs/h/ent_id.hpp>
00046 #include <oess_1/defs/h/quantity.hpp>
00047 
00048 namespace oess_1 {
00049 
00050 namespace io {
00051 
00052 //
00053 // istream_t
00054 //
00055 
00062 class OESS_1__IO__TYPE  istream_t {
00063   public :
00064     virtual ~istream_t();
00065 
00070     virtual void
00071     read( oess_1::char_t * p, size_t count ) = 0;
00072 
00077     virtual void
00078     read( oess_1::schar_t * p, size_t count ) = 0;
00079 
00084     virtual void
00085     read( oess_1::uchar_t * p, size_t count ) = 0;
00086 
00091     virtual void
00092     read( oess_1::short_t * p, size_t count ) = 0;
00093 
00098     virtual void
00099     read( oess_1::ushort_t * p, size_t count ) = 0;
00100 
00105     virtual void
00106     read( oess_1::int_t * p, size_t count ) = 0;
00107 
00112     virtual void
00113     read( oess_1::uint_t * p, size_t count ) = 0;
00114 
00119     virtual void
00120     read( oess_1::single_t * p, size_t count ) = 0;
00121 
00126     virtual void
00127     read( oess_1::double_t * p, size_t count ) = 0;
00128 
00138     virtual void
00139     read( std::string & p ) = 0;
00140 
00148     virtual void
00149     read( oess_1::defs::quantity_t & p ) = 0;
00150 
00152 
00155     virtual bool
00156     eof() const = 0;
00157 };
00158 
00159 //
00160 // ostream_t
00161 //
00162 
00169 class OESS_1__IO__TYPE  ostream_t {
00170   public :
00171     virtual ~ostream_t();
00172 
00177     virtual void
00178     write( const oess_1::char_t * p, size_t count ) = 0;
00179 
00184     virtual void
00185     write( const oess_1::schar_t * p, size_t count ) = 0;
00186 
00191     virtual void
00192     write( const oess_1::uchar_t * p, size_t count ) = 0;
00193 
00198     virtual void
00199     write( const oess_1::short_t * p, size_t count ) = 0;
00200 
00205     virtual void
00206     write( const oess_1::ushort_t * p, size_t count ) = 0;
00207 
00212     virtual void
00213     write( const oess_1::int_t * p, size_t count ) = 0;
00214 
00219     virtual void
00220     write( const oess_1::uint_t * p, size_t count ) = 0;
00221 
00226     virtual void
00227     write( const oess_1::single_t * p, size_t count ) = 0;
00228 
00233     virtual void
00234     write( const oess_1::double_t * p, size_t count ) = 0;
00235 
00244     virtual void
00245     write( const std::string & p ) = 0;
00246 
00254     virtual void
00255     write( const oess_1::defs::quantity_t & p ) = 0;
00256 };
00257 
00258 
00260 inline istream_t &
00261 operator>>( istream_t & s, oess_1::char_t & o ) {
00262   s.read( &o, 1 );
00263   return s;
00264 }
00265 
00267 inline ostream_t &
00268 operator<<( ostream_t & s, const oess_1::char_t & o ) {
00269   s.write( &o, 1 );
00270   return s;
00271 }
00272 
00274 inline istream_t &
00275 operator>>( istream_t & s, oess_1::schar_t & o ) {
00276   s.read( &o, 1 );
00277   return s;
00278 }
00279 
00281 inline ostream_t &
00282 operator<<( ostream_t & s, const oess_1::schar_t & o ) {
00283   s.write( &o, 1 );
00284   return s;
00285 }
00286 
00288 inline istream_t &
00289 operator>>( istream_t & s, oess_1::uchar_t & o ) {
00290   s.read( &o, 1 );
00291   return s;
00292 }
00293 
00295 inline ostream_t &
00296 operator<<( ostream_t & s, const oess_1::uchar_t & o ) {
00297   s.write( &o, 1 );
00298   return s;
00299 }
00300 
00302 inline istream_t &
00303 operator>>( istream_t & s, oess_1::short_t & o ) {
00304   s.read( &o, 1 );
00305   return s;
00306 }
00307 
00309 inline ostream_t &
00310 operator<<( ostream_t & s, const oess_1::short_t & o ) {
00311   s.write( &o, 1 );
00312   return s;
00313 }
00314 
00316 inline istream_t &
00317 operator>>( istream_t & s, oess_1::ushort_t & o ) {
00318   s.read( &o, 1 );
00319   return s;
00320 }
00321 
00323 inline ostream_t &
00324 operator<<( ostream_t & s, const oess_1::ushort_t & o ) {
00325   s.write( &o, 1 );
00326   return s;
00327 }
00328 
00330 inline istream_t &
00331 operator>>( istream_t & s, oess_1::int_t & o ) {
00332   s.read( &o, 1 );
00333   return s;
00334 }
00335 
00337 inline ostream_t &
00338 operator<<( ostream_t & s, const oess_1::int_t & o ) {
00339   s.write( &o, 1 );
00340   return s;
00341 }
00342 
00344 inline istream_t &
00345 operator>>( istream_t & s, oess_1::uint_t & o ) {
00346   s.read( &o, 1 );
00347   return s;
00348 }
00349 
00351 inline ostream_t &
00352 operator<<( ostream_t & s, const oess_1::uint_t & o ) {
00353   s.write( &o, 1 );
00354   return s;
00355 }
00356 
00358 inline istream_t &
00359 operator>>( istream_t & s, oess_1::single_t & o ) {
00360   s.read( &o, 1 );
00361   return s;
00362 }
00363 
00365 inline ostream_t &
00366 operator<<( ostream_t & s, const oess_1::single_t & o ) {
00367   s.write( &o, 1 );
00368   return s;
00369 }
00370 
00372 inline istream_t &
00373 operator>>( istream_t & s, oess_1::double_t & o ) {
00374   s.read( &o, 1 );
00375   return s;
00376 }
00377 
00379 inline ostream_t &
00380 operator<<( ostream_t & s, const oess_1::double_t & o ) {
00381   s.write( &o, 1 );
00382   return s;
00383 }
00384 
00386 inline istream_t &
00387 operator>>( istream_t & s, std::string & o ) {
00388   s.read( o );
00389   return s;
00390 }
00391 
00393 inline ostream_t &
00394 operator<<( ostream_t & s, const std::string & o ) {
00395   s.write( o );
00396   return s;
00397 }
00398 
00400 inline istream_t &
00401 operator>>( istream_t & s, oess_1::defs::quantity_t & o ) {
00402   s.read( o );
00403   return s;
00404 }
00405 
00407 inline ostream_t &
00408 operator<<( ostream_t & s, const oess_1::defs::quantity_t & o ) {
00409   s.write( o );
00410   return s;
00411 }
00412 
00414 inline istream_t &
00415 operator>>( istream_t & s, oess_1::ent_id_t & o ) {
00416   s.read( &o.m_slice_id, 1 );
00417   s.read( &o.m_ent_id, 1 );
00418   return s;
00419 }
00420 
00422 inline ostream_t &
00423 operator<<( ostream_t & s, const oess_1::ent_id_t & o ) {
00424   s.write( &o.m_slice_id, 1 );
00425   s.write( &o.m_ent_id, 1 );
00426   return s;
00427 }
00428 
00429 } /* namespace io */
00430 
00431 } /* namespace oess_1 */
00432 
00433 #endif
00434 

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