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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #include "Pstream.H"
00038
00039 #ifndef OPstream_H
00040 #define OPstream_H
00041
00042 #include "Ostream.H"
00043
00044
00045
00046 namespace Foam
00047 {
00048
00049
00050
00051
00052
00053 class OPstream
00054 :
00055 public Pstream,
00056 public Ostream
00057 {
00058
00059
00060 int toProcNo_;
00061 bool bufferedTransfer_;
00062
00063
00064
00065
00066
00067 template<class T>
00068 inline void writeToBuffer(const T&);
00069
00070
00071 inline void writeToBuffer(const char&);
00072
00073
00074 inline void writeToBuffer(const void* data, size_t count);
00075
00076
00077 public:
00078
00079
00080
00081
00082
00083 OPstream
00084 (
00085 const int toProcNo,
00086 const label bufSize = 0,
00087 const bool bufferedTransfer = true,
00088 streamFormat format=BINARY,
00089 versionNumber version=currentVersion
00090 );
00091
00092
00093
00094
00095 ~OPstream();
00096
00097
00098
00099
00100
00101
00102
00103 ios_base::fmtflags flags() const
00104 {
00105 return ios_base::fmtflags(0);
00106 }
00107
00108
00109
00110
00111
00112 static bool write
00113 (
00114 const int toProcNo,
00115 const char* buf,
00116 const std::streamsize bufSize,
00117 const bool bufferedTransfer = true
00118 );
00119
00120
00121 Ostream& write(const token&);
00122
00123
00124 Ostream& write(const char);
00125
00126
00127 Ostream& write(const char*);
00128
00129
00130 Ostream& write(const word&);
00131
00132
00133 Ostream& write(const string&);
00134
00135
00136 Ostream& write(const label);
00137
00138
00139 Ostream& write(const floatScalar);
00140
00141
00142 Ostream& write(const doubleScalar);
00143
00144
00145 Ostream& write(const char*, std::streamsize);
00146
00147
00148 void indent()
00149 {}
00150
00151
00152
00153
00154
00155 void flush()
00156 {}
00157
00158
00159 void endl()
00160 {}
00161
00162
00163 int width() const
00164 {
00165 return 0;
00166 }
00167
00168
00169 int width(const int)
00170 {
00171 return 0;
00172 }
00173
00174
00175 int precision() const
00176 {
00177 return 0;
00178 }
00179
00180
00181 int precision(const int)
00182 {
00183 return 0;
00184 }
00185
00186
00187 bool bufferedTransfer() const
00188 {
00189 return bufferedTransfer_;
00190 }
00191
00192
00193 bool bufferedTransfer(const bool bfrdTransfer)
00194 {
00195 bool oldBufferedTransfer = bufferedTransfer_;
00196 bufferedTransfer_ = bfrdTransfer;
00197 return oldBufferedTransfer;
00198 }
00199
00200
00201
00202
00203
00204 ios_base::fmtflags flags(const ios_base::fmtflags)
00205 {
00206 return ios_base::fmtflags(0);
00207 }
00208
00209
00210
00211
00212
00213 void print(Ostream&) const;
00214 };
00215
00216
00217
00218
00219 }
00220
00221
00222
00223
00224 # include "OPstreamI.H"
00225
00226
00227
00228 #endif
00229
00230