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_MARSHALLER_H_
00028 #define CEYLAN_MARSHALLER_H_
00029
00030
00031 #include "CeylanMiddleware.h"
00032 #include "CeylanSystem.h"
00033
00034
00035
00036 namespace Ceylan
00037 {
00038
00039
00040 namespace System
00041 {
00042
00043
00044
00045 class InputOutputStream ;
00046
00047
00048
00049
00050
00051
00052
00053 class MemoryStream ;
00054
00055
00056 }
00057
00058
00059
00060
00061 namespace Middleware
00062 {
00063
00064
00065
00070 class CEYLAN_DLL MarshallException: public MiddlewareException
00071 {
00072
00073 public:
00074
00075
00076 MarshallException( const std::string & message ) ;
00077
00078 virtual ~MarshallException() throw() ;
00079
00080
00081 } ;
00082
00083
00084
00085
00091 class CEYLAN_DLL DecodeException: public MarshallException
00092 {
00093
00094 public:
00095
00096
00097 DecodeException( const std::string & message ) ;
00098
00099 virtual ~DecodeException() throw() ;
00100
00101
00102 } ;
00103
00104
00105
00106
00112 class CEYLAN_DLL EncodeException: public MarshallException
00113 {
00114
00115 public:
00116
00117
00118 EncodeException( const std::string & message ) ;
00119
00120 virtual ~EncodeException() throw() ;
00121
00122
00123 } ;
00124
00125
00126
00127
00163 class CEYLAN_DLL Marshaller: public TextDisplayable
00164 {
00165
00166
00167
00168 public:
00169
00170
00171
00188 explicit Marshaller(
00189 System::InputOutputStream & lowerLevelStream,
00190 System::Size bufferedSize = 0 ) ;
00191
00192
00193
00195 virtual ~Marshaller() throw() ;
00196
00197
00198
00239 virtual System::Size retrieveData(
00240 System::Size requestedSize = 0 ) ;
00241
00242
00243
00256 virtual const std::string toString(
00257 Ceylan::VerbosityLevels level = Ceylan::high ) const ;
00258
00259
00260
00261
00262 protected:
00263
00264
00265
00271 System::InputOutputStream * _lowerLevelStream ;
00272
00273
00274
00275 inline bool isBuffered() const
00276 {
00277
00278 return _bufferStream != 0 ;
00279
00280 }
00281
00282
00283
00291 System::MemoryStream * _bufferStream ;
00292
00293
00294
00295
00296 private:
00297
00298
00307 Marshaller( const Marshaller & source ) ;
00308
00309
00318 Marshaller & operator = ( const Marshaller & source ) ;
00319
00320
00321
00322
00323 } ;
00324
00325
00326 }
00327
00328 }
00329
00330
00331
00332 #endif // CEYLAN_MARSHALLER_H_
00333