00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef CEYLAN_LIGHT_WEIGHT_MARSHALLER_H_
00028 #define CEYLAN_LIGHT_WEIGHT_MARSHALLER_H_
00029
00030
00031 #include "CeylanMarshaller.h"
00032 #include "CeylanInputStream.h"
00033 #include "CeylanMemoryStream.h"
00034
00035
00036
00037 namespace Ceylan
00038 {
00039
00040
00041
00043 namespace Middleware
00044 {
00045
00046
00047
00077 class CEYLAN_DLL LightWeightMarshaller : public Marshaller
00078 {
00079
00080
00081
00082 public:
00083
00084
00102 explicit LightWeightMarshaller(
00103 System::InputOutputStream & lowerLevelStream,
00104 System::Size bufferedSize = 0 ) ;
00105
00106
00108 virtual ~LightWeightMarshaller() throw() ;
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00133 virtual Ceylan::Sint8 decodeSint8() ;
00134
00135
00136
00145 virtual Ceylan::Uint8 decodeUint8() ;
00146
00147
00148
00157 virtual Ceylan::Sint16 decodeSint16() ;
00158
00159
00160
00169 virtual Ceylan::Uint16 decodeUint16() ;
00170
00171
00172
00181 virtual Ceylan::Sint32 decodeSint32() ;
00182
00183
00184
00193 virtual Ceylan::Uint32 decodeUint32() ;
00194
00195
00196
00197
00198
00199
00200
00201
00202
00211 virtual Ceylan::Float32 decodeFloat32() ;
00212
00213
00214
00223 virtual Ceylan::Float64 decodeFloat64() ;
00224
00225
00226
00227
00228
00229
00230
00244 virtual void decodeString( std::string & result ) ;
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00271 virtual void encodeSint8( Ceylan::Sint8 toEncode ) ;
00272
00273
00274
00282 virtual void encodeUint8( Ceylan::Uint8 toEncode ) ;
00283
00284
00285
00286
00294 virtual void encodeSint16( Ceylan::Sint16 toEncode ) ;
00295
00296
00297
00305 virtual void encodeUint16( Ceylan::Uint16 toEncode ) ;
00306
00307
00308
00309
00317 virtual void encodeSint32( Ceylan::Sint32 toEncode ) ;
00318
00319
00320
00328 virtual void encodeUint32( Ceylan::Uint32 toEncode ) ;
00329
00330
00331
00332
00333
00334
00335
00336
00344 virtual void encodeFloat32( Ceylan::Float32 toEncode ) ;
00345
00346
00347
00355 virtual void encodeFloat64( Ceylan::Float64 toEncode ) ;
00356
00357
00358
00359
00372 virtual void encodeString( std::string & toEncode ) ;
00373
00374
00375
00376
00377
00390 virtual const std::string toString(
00391 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00392
00393
00394
00395
00396
00397 protected:
00398
00399
00400
00409 inline System::InputOutputStream & getEffectiveStream()
00410 {
00411
00412 if ( isBuffered() )
00413 return * _bufferStream ;
00414 else
00415 return * _lowerLevelStream ;
00416
00417 }
00418
00419
00420
00421 private:
00422
00423
00432 LightWeightMarshaller( const LightWeightMarshaller & source ) ;
00433
00434
00435
00444 LightWeightMarshaller & operator = (
00445 const LightWeightMarshaller & source ) ;
00446
00447
00448
00449
00450 } ;
00451
00452
00453 }
00454
00455 }
00456
00457
00458
00459 #endif // CEYLAN_LIGHT_WEIGHT_MARSHALLER_H_
00460