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